- Posts: 15
COMMUNITY FORUM
exclude Featured items from tag listings
- Miss Rant A Lot
- Topic Author
- Offline
- New Member
Less
More
7 years 5 months ago #162412
by Miss Rant A Lot
exclude Featured items from tag listings was created by Miss Rant A Lot
Hey, I know it's not doable via K2 backend or anything but is there a code I can remove from tag.php so that featured items don't show please?
Only thing I could find with regards to featured is this line of code
<?php if($item->featured): ?>
<!-- Featured flag -->
<span>
<sup>
<?php echo JText::_('K2_FEATURED'); ?>
</sup>
</span>
<?php endif; ?>
but that only removes the featured flag and not the item itself
Thanks
Only thing I could find with regards to featured is this line of code
<?php if($item->featured): ?>
<!-- Featured flag -->
<span>
<sup>
<?php echo JText::_('K2_FEATURED'); ?>
</sup>
</span>
<?php endif; ?>
but that only removes the featured flag and not the item itself
Thanks
Please Log in or Create an account to join the conversation.
- Yejiel
- Offline
- New Member
Less
More
- Posts: 2
7 years 5 months ago #162414
by Yejiel
Replied by Yejiel on topic exclude Featured items from tag listings
check on: template => html => mod_k2_content
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 5 months ago #162419
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic exclude Featured items from tag listings
You can use the <?php if($item->featured): ?> and <?php if(!$item->featured): ?> flags in order to render the entire item or not.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Miss Rant A Lot
- Topic Author
- Offline
- New Member
Less
More
- Posts: 15
7 years 5 months ago - 7 years 5 months ago #162450
by Miss Rant A Lot
Replied by Miss Rant A Lot on topic exclude Featured items from tag listings
So I could just change that code to instead of displaying a flag, to remove the article
<?php if($item->featured): ?>
<!-- Hide from View -->
("div").hide();
<?php endif; >
Would this work?
<?php if($item->featured): ?>
<!-- Hide from View -->
("div").hide();
<?php endif; >
Would this work?
Last edit: 7 years 5 months ago by Miss Rant A Lot.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 5 months ago #162457
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic exclude Featured items from tag listings
Not really,
would be a better approach.
<?php if(!$item->featured): ?>
Code for the item's markup goes here
<?php endif; ?>
would be a better approach.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Miss Rant A Lot
- Topic Author
- Offline
- New Member
Less
More
- Posts: 15
7 years 5 months ago #162483
by Miss Rant A Lot
Replied by Miss Rant A Lot on topic exclude Featured items from tag listings
Thank You
I tried
<?php if(!$item->featured) echo 'disabled'; ?>
and
<?php if(!$item->featured) echo ('disabled','disabled'); ?>
But I'm not sure what actually is the call to hide/disable an element. I know you can exclude featured articles when creating a menu, so I had a look and these were the options so tried going by that
$('jform_params_catFeaturedItems').removeProperty('disabled');
Tried <?php if(!$item->featured) echo 'disabled'; ?>
bu that just turned the featured text under title to say "disabled"
$('jform_params_catFeaturedItems').setProperty('disabled','disabled');
Sorry for all the Qs, Claire
I tried
<?php if(!$item->featured) echo 'disabled'; ?>
and
<?php if(!$item->featured) echo ('disabled','disabled'); ?>
But I'm not sure what actually is the call to hide/disable an element. I know you can exclude featured articles when creating a menu, so I had a look and these were the options so tried going by that
$('jform_params_catFeaturedItems').removeProperty('disabled');
Tried <?php if(!$item->featured) echo 'disabled'; ?>
bu that just turned the featured text under title to say "disabled"
$('jform_params_catFeaturedItems').setProperty('disabled','disabled');
Sorry for all the Qs, Claire
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 5 months ago #162488
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic exclude Featured items from tag listings
This won't really work.
You are mixing PHP with JS, which won't work.
The entire code for the item should be placed inside the if check.
You are mixing PHP with JS, which won't work.
The entire code for the item should be placed inside the if check.
<?php if (!$item->featured): ?>
ENTIRE Code for the item's markup goes here
<?php endif; ?>
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.