Keyword

[SOLVED] tag same as category item

More
8 years 11 months ago #144113 by Amir
tag same as category item was created by Amir
Hi ,

How can i need change tag layout same as category item , when i copy code from category item file to tag file it's not working .

Best Regards,
Mike

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 11 months ago #144117 by Krikor Boghossian
Replied by Krikor Boghossian on topic tag same as category item
You need to only change the css classes. Copying php code will produce fatal errors.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
8 years 11 months ago #144142 by Amir
Replied by Amir on topic tag same as category item
Dear Krikor ,

Thank you for your promptly reply ,

My issue is not css class i have problem with js file when i use js file in category item file it's ok but same as code use in tag file doesn't work !

Best Regards,
Mike

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

More
8 years 11 months ago - 8 years 11 months ago #144144 by Joe Campbell
Replied by Joe Campbell on topic tag same as category item
Hello Amir,

There's two things you need to be mindful of when working with category vs tag override files:

1) Class name: K2 uses a prefix for each view type at the beginning of the class name: tagItemTitle vs. catItemTitle
2) How you render elements (title, extra fields, etc.): tag pages starts with $item-> while category starts with $this->

See highlighted examples below for a comparison...

TAG CODE ::: tag.php

<h2 class="tagItemTitle">
<?php echo $item->extraFields->NAME->value; ?>
<?php echo $item->title; ?>

CATEGORY CODE ::: category_item.php

<h2 class="catItemTitle">
<?php echo $this->item->extraFields->NAME->value; ?>
<?php echo $this->item->title; ?>

I hope this helps,

Joe Campbell
Last edit: 8 years 11 months ago by Joe Campbell.

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

More
8 years 11 months ago #144145 by Amir
Replied by Amir on topic tag same as category item
Hello Joseph ,

Your explanation was so perfect .

Kind Regards,
Amir

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


Powered by Kunena Forum