Keyword

H1 for titles in category page

  • kalixo
  • kalixo's Avatar Topic Author
  • Offline
  • Junior Member
More
8 years 3 months ago #155428 by kalixo
H1 for titles in category page was created by kalixo
Dear all,
I have category pages on which I list only K2 items. Becasue those pages are without category title and category descritopn, they don't have any H1 or H2, which are needed by SEO.
How to modify files, to get desired H1 and H2?

I think, that the best way is to use category item layout, and use:
H1 tag for Primary count,
H2 tag for Secondary count
but I couldn't handle with php.

Could someone help me with this?
Thanks in advance!
Kalixo

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 3 months ago #155443 by Krikor Boghossian
Replied by Krikor Boghossian on topic H1 for titles in category page
Hello,

You can override the category.php file. The headers you want to edit can be identified from the language strings,
More info on overrides can be found here: getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

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

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

  • kalixo
  • kalixo's Avatar Topic Author
  • Offline
  • Junior Member
More
8 years 3 months ago #155549 by kalixo
Replied by kalixo on topic H1 for titles in category page
Dear Krikor,
thanks for helping me with this, but dupliacting template won't resolve my problem, not in this case.
When I looked over the category.php file I can see code for "Primary count" and also for the "Secondary count", but for each item there is php code that includes "category_item.php" - so there is only one php for item where I could input my "H" tags.
I can see that for each "count" there is a code as below:
$this->item=$item; echo $this->loadTemplate('item');
so I suppose I should duplicate "category_item.php" and name it "category_item_primary.php" for "Primary count" and put in there "H1" for heading, and for "Secondary count" I should create file "category_item_secondary.php" and put in "H2" for heading. BUT unfortunatly I don't know how to change the php code for each "count" to refer not to "category_item.php" but to the "category_item_primary.php" and "category_item_secondary.php".

I hope that it's understable ;)
Thank's!

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 3 months ago #155580 by Krikor Boghossian
Replied by Krikor Boghossian on topic H1 for titles in category page
This is possible and quite easy.
In each group (leading, primary, etc) locate this line of code:
echo $this->loadTemplate('item');

This line of code loads the category-item.php file, so changing this to:
echo $this->loadTemplate('item_leading');

will load the category_item_leading file.

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

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

  • kalixo
  • kalixo's Avatar Topic Author
  • Offline
  • Junior Member
More
8 years 3 months ago #155668 by kalixo
Replied by kalixo on topic H1 for titles in category page
Krikor - you are genius!
Thnaks you so much!

best regards,
Kalixo

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 3 months ago #155690 by Krikor Boghossian
Replied by Krikor Boghossian on topic H1 for titles in category page
You 're welcome :)

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

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


Powered by Kunena Forum