Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Hiding Authors

Hiding Authors

Looking to see if we can hide the author by line depending on category. We have multiple departments that have both a news category and a information category. We use one template for each department but would like to hide the by line if it is an information category article.

nharroff
Beginner Modder
ranks
useravatar
Offline
14 Posts
Administrator has disabled public posting

Re: Hiding Authors

Hi nharroff,

While Chameleon can detect when the user is viewing a certain category, there isn't an action in Chameleon that can specifically hide the author display. That's not to say it's impossible... you may be able to use the find-and-replace action with a regex to remove the author display HTML from the page.

If you can send me a link to one of the pages that shows the author where you would like it removed, I'll create a regex for you that can search for that html and remove it from the page.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Hiding Authors

Hi,

the HTML of a typical author line is this:

<dd class="createdby" itemprop="author" itemscope itemtype="https://schema.org/Person">
                    Posted by <span itemprop="name"><a href="/component/jsn/jlund?Itemid=">Jason Lund</a></span>    </dd>


So you can do a find-and-replace with the following regex, replacing it with a blank:

#<dd class="createdby"(.|\s)*?</dd>#

So that goes in the Succeed Action part. You obviously also need to set a condition for this to trigger: you can select all the categories in the Content and Components tab, in the "Categories" field. You might also want to decide whether this should affect just the articles in the given category, OR the articles in those categories plus any of their subcategories.

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Hiding Authors

Worked! Thank you! If you are reading this in the future, let me save you the stupid 20 minutes I wasted and remind you to select 'regex match' instead of leaving it as 'case insensitive' and driving yourself crazy.

nharroff
Beginner Modder
ranks
useravatar
Offline
14 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1686
Total Polls:
6
Total Posts:
5933
Total Posts Today:
7
User Info:
 
Total Users:
4432
Newest User:
kinggambling14
Members Online:
0
Guests Online:
156

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked