[SOLVED] Customizing mod_flexicategories to include image

More
8 years 10 months ago - 8 years 10 months ago #54870 by agata
Hi,
I'd like to include a grid of child categories of a particular category on the item page so I tried to do it via the flexi categories module but it only allows me to add an unordered list of categories' titles with links but I need to modify the html output of the module and include the category image as well. The default.php file features very little code and I didn't manage to find where the code loading inside the list is being grabbed from.
Code:
<?php defined('_JEXEC') or die; ?> <ul class="categories-module<?php echo $moduleclass_sfx; ?>"> <?php require JModuleHelper::getLayoutPath('mod_flexicategories', $params->get('layout', 'default') . '_items'); ?> </ul>
Any suggestions will be welcome.
Thanks,
Agata

edit: sorry, I mistakenly created the topic here and not in Templates and CSS, if you could move it that would be great since I can't delete it
Last edit: 8 years 10 months ago by agata.

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

More
8 years 10 months ago #54872 by ggppdk
Hello

the module was added as we needed it, and it is a copy of the Joomla module, customized to
- produce FC category links
- to take into account the multi-category assignments, in regards to item counting


indeed you thoughts are our thoughts too,
- so now that we have the module, we will do that in a future version
e.g. adding the images is minimal work,
and the image parameters will be the same image parameters as in component / category

this can be a direct copy of our code in category templates, or also the code for rendering custom thumbnails for category images could be moved to common file too

here is a new enhancement issue:
github.com/FLEXIcontent/flexicontent-cck/issues/220


-- 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...
The following user(s) said Thank You: agata

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

More
8 years 10 months ago #54877 by agata
Cool, thanks. What's the time-frame for this more or less? Days, weeks, months?
Cheers,
Agata

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

More
8 years 10 months ago - 8 years 10 months ago #54878 by ggppdk
Hello

there is no time frame, this is not difficult work, just it will be done in v3.1
estimated time is 1 hour implementation / testing / etc,
because we already said to use the same category image parameters as in component / category

there are a lot of enhancement issues that need little time,
- but you must also consider, after adding something quite easy, you may introduce a bug / and bug reports

to make a custom template now
you can
1. duplicate: (or you can create the 'mydefault' inside your template folder)
tmpl/default.php
tmpl/default_items.php
as
tmpl/mydefault.php
tmpl/mydefault_items.php

2. replace inside -BOTH- files:
<?php require JModuleHelper::getLayoutPath('mod_flexicategories', $params->get('layout', 'default') . '_items'); ?>
with
<?php require JModuleHelper::getLayoutPath('mod_flexicategories', $params->get('layout', 'mydefault') . '_items'); ?>

3. add you category image inside the loop
using
<img src=".... <?php echo ...;?>"/>


-- 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...
Last edit: 8 years 10 months ago by ggppdk.

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

More
8 years 10 months ago #54888 by agata
Hi, thanks for this. I must have been really tired yesterday because I failed to notice the default_items.php and couldn't figure out where the items were being loaded from. Anyway, I created an override but I can't figure out what the variable for the image would be. Tried $cat->img, $cat->image, $cat->img_src, etc but nothing works.
Thanks,
Agata

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

More
8 years 10 months ago #54891 by ggppdk
Hello

it is:
$cat->getParams()->get('image')

but you can use v3 BETA7d (which has parameter for category images in the categories module):
github.com/FLEXIcontent/flexicontent-cck...es/tag/v3.0.0_Beta7d


-- 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...
The following user(s) said Thank You: agata

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.709 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline