Forum

Thread tagged as: Question

Displaying Category Description in Content Template

Hi

I'm currently working on some vacancy pages and am using perch:categories to select which department the vacancy is for.

On an aside column I'm wanting to add a little bit of info about the department using the category description, but nothing is being outputted.

Here's my code:

<perch:categories id="catDept" set="department">
                    <h2><perch:category id="catTitle" /></h2>
                    <p><perch:category id="catDesc" /></p>
                </perch:categories>

...the category title is being displayed perfectly, but I can't get the description to display.

Any pointers would be much appreciated.

Glen

Glen Piggott

Glen Piggott 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Don't forget the type attribute on your tag.

Hi Drew

I've now got the following but the category description still isn't displaying, the category title is:

                <perch:categories id="catDept" set="department">
                    <h2><perch:category id="catTitle" type="text" /></h2>
                    <perch:category id="catDesc" type="textarea" html="true" />
                </perch:categories>
Drew McLellan

Drew McLellan 2638 points
Perch Support

What does <perch:showall /> show you?

ID  Value
perch_page_path /perch/core/apps/content/edit/index.php
_id 20
vacancyh1   Legal Secretary
catDept 
Array
(
    [0] => 3
)
catOffice   
Array
(
    [0] => 9
)
vacancyDesc 
We currently have a legal secretarial vacancy in our new Downham Market office.  This position is in the Private Client / Probate team, if you are looking for an exciting new challenge; contact us with your current CV to find out more.

Previous legal experience would be an advantage.

The successful candidate will have accurate word processing skills.  The role includes typing from digital dictation, then the usual ancillary secretarial duties including filing, photocopying, shredding and telephone message taking.

vacancyRespon   
Array
(
    [0] => Array
        (
            [ResponLi] => Bullet 1
        )

    [1] => Array
        (
            [ResponLi] => Bullet 2
        )

)
vacancyRequire  
Array
(
    [0] => Array
        (
            [RequireLi] => Bullet 1
        )

    [1] => Array
        (
            [RequireLi] => Bullet 2
        )

)
vacancyAppH3    Interested? Apply now!
itemRowID   603
itemID  20
regionID    42
pageID  18
itemRev 20
itemOrder   1000
itemJSON    {"_id":"20","vacancyh1":"Legal{...}
itemSearch  Legal Secretary Wills & Probate Downham Market We currently have a legal secretarial vacancy in{...}
itemUpdated 2017-12-22 10:45:34
itemUpdatedBy   1
perch_item_first    true
perch_item_last true
perch_item_zero_index   0
perch_item_index    1
perch_item_rev_index    1
perch_item_rev_zero_index   0
perch_item_odd  
perch_item_count    1
perch_namespace perch:content
Drew McLellan

Drew McLellan 2638 points
Perch Support

Is catDesc a field you've added to your category template?

Go watch the tutorial videos.