Top Category before the title in Flexicontent Module

More
12 years 5 months ago #32771 by Hyper
Hello, i've another question for you!
I would to show in each article area and flexicontent module, the name of the top article's category in a div declared by css. I look forward to your reply! Thanks!

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

More
12 years 5 months ago #32779 by micker
hello

hyper wrote: the name of the top article's category

what is this ?
can put a screenshot ?

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
12 years 5 months ago #32782 by Hyper

micker wrote: hello

hyper wrote: the name of the top article's category

what is this ?
can put a screenshot ?


Example:

TOP CATEGORY
|- Sub-Category
|- Article X
TOP CATEGORY 2
|- Sub-Category
|- Article Y
TOP CATEGORY 3
|- Sub-Category
|- Article Z


FLEXICONTENT MODULE (Latest News)
|TOP Category (name): Article X Title
|TOP Category 2 (name): Article Y Title

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

More
12 years 5 months ago #32785 by ggppdk
There is no such option for the module, but $item->catid contains the main category of each item

So you could do this:
-- 1 --
- just before:
Code:
<?php if ($display_title_feat) : ?>
- AND just before:
Code:
<?php if ($display_title) : ?>

ADD:
Code:
<?php $db =JFactory::getDBO(); $query = 'SELECT c.title FROM #__categories WHERE id='.(int)$item->id; $db->setQuery( $query ); $cat_title = $db->loadResult(); ?>

-- 2 --
Then change lines:
Code:
<?php if ($display_title_feat) : ?> <?php if ($display_title) : ?>
to be :
Code:
<?php if ($display_title_feat) : ?> <?php echo $cat_title; ?> - <?php if ($display_title) : ?> <?php echo $cat_title; ?> -


-- 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...

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

More
12 years 3 months ago #34550 by danio_d
Hi,

I did as you wrote, but the category name does not show up.
I think in this line:
Code:
$query = 'SELECT c.title FROM #__categories WHERE id='.(int)$item->id;

should be catid
Code:
$query = 'SELECT c.title FROM #__categories WHERE id='.$item->catid ;

but it does not change anything

What could be the reason that the category is not showing?

dede

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

More
12 years 3 months ago #34555 by ggppdk
Sorry the query had 2 errors , i must have been tired or hasty when i wrote it

The table alias c is also missing ...
You can try:
Code:
$query = 'SELECT title FROM #__categories WHERE id='.$item->catid ;


-- 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...

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.393 seconds
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
Save