[SOLVED] Multicategory view - how to get image, title / description of every category

More
3 years 2 months ago - 3 years 2 months ago #54685 by agata
Hello,
In the menu item for a muticategory view there is a tab for Parameters: Category Info & Options however I don't understand where the image and description configured in the options in that tab would be retrieved from. I tried setting a default image in case there was no category image, like so
<?php if (!empty($this->category->image))?>
<div class="content-top__bg" style="background-image:url('<?php echo $this->category->image_src; ?>');"></div>
<?php else:?>
<div class="content-top__bg" style="background-image:url('/images/429.jpg');"></div>
<?php endif;?>
but it doesn't work.
Thanks,
Agata
Last edit: 3 years 2 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago - 3 years 2 months ago #54686 by ggppdk
Hello

so you want to do custom template?

you will need to use for:
- subcategories
foreach ($this->categories as $cat) {
   echo $cat->image;    // This is the thumbnail image with optional category link
   echo $cat->title;    // This is title
   echo $cat->description;    // ...
   echo $cat->params('image');    // The filename of the image
}

- peer categories
foreach ($this->peercats as $cat) {
   ...
}

to get more info do:
echo "<pre>"; print_r($cat); echo "<pre>"; exit;


-- FLEXIcontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!
Last edit: 3 years 2 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago - 3 years 2 months ago #54687 by agata
Hi, thanks but I don't have problems with sub- and peer-category images but there's yet another tab there, just like for a single category, that handles the image and description for the multicat page the menu item leads to

www.dropbox.com/s/p4sudfx6f5ysxjo/Screen...%2017.09.45.png?dl=0

I hope this clears things up.
Agata
Last edit: 3 years 2 months ago by agata.

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago - 3 years 2 months ago #54689 by ggppdk
Hello

i see, we need to update our menu item to avoid confusion

The TAB in the picture, is applicable in views

- single category
- tags (new* in v3 BETA7 via category view) limited to a specific category
- favourites (new* in v3 BETA7 via category view) limited to a specific category
- myitems, limited to a specific category
- author items, limited to a specific category


For
-- multicategory view, the "sub categories" parameters are used and you will need to use:
foreach ($this->categories as $cat) {
   echo $cat->image;    // This is the thumbnail image with optional category link
   echo $cat->title;    // This is title
   echo $cat->description;    // ...
   echo $cat->params('image');    // The filename of the image
}


-- FLEXIcontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!
Last edit: 3 years 2 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #54693 by agata
I was afraid this was so, thank you for your assistance with this.
Best,
Agata

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
© 2018 Flexicontent. All Rights Reserved.