Keyword

Label as title

  • cyfcaloryfrio
  • cyfcaloryfrio's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 10 months ago #120923 by cyfcaloryfrio
Label as title was created by cyfcaloryfrio
Hi!!. We need need to show at the top of a list of items, the label of the section to which they belong. In the attached image shows the idea.

Thank you very much.


Attachment not found

Attachments:

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 10 months ago #120924 by Yiota
Replied by Yiota on topic Re: Label as title
You could use the page title through the menu item to do this.

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

  • cyfcaloryfrio
  • cyfcaloryfrio's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 10 months ago #120925 by cyfcaloryfrio
Replied by cyfcaloryfrio on topic Re: Label as title
Thanks for your reply, but how would the code for do it??

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 10 months ago #120926 by Yiota
Replied by Yiota on topic Re: Label as title
You don't have to add any extra code. The page title will show up if you enable it through your category menu item.
Its class is componentheading though and not h1 but you can change that if you want.

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

  • cyfcaloryfrio
  • cyfcaloryfrio's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 10 months ago #120927 by cyfcaloryfrio
Replied by cyfcaloryfrio on topic Re: Label as title
within the component k2?. Can you specify where to make the change??

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 10 months ago #120928 by Yiota
Replied by Yiota on topic Re: Label as title
Were you able to show your header up to this point?
To change the class you need to make a small change through the category.php of your template overrides. If you do not use template overrides you will have to create them in order to make the change. Read here on how overrides work getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

Then open category.php located in template/your_template/html/com_k2/default/ or if you have a custom sub-template edit that one and locate this block of code
<?php if($this->params->get('show_page_title')): ?>
	<!-- Page title -->
	<div class="componentheading<?php echo $this->params->get('pageclass_sfx')?>">
		<?php echo $this->escape($this->params->get('page_title')); ?>
	</div>
	<?php endif; ?>
Change the <div class="componentheading"> to <h1>.

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

  • cyfcaloryfrio
  • cyfcaloryfrio's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 10 months ago #120929 by cyfcaloryfrio
Replied by cyfcaloryfrio on topic Re: Label as title
Can you tell me, how is the process to show the header up??.
The code is great!!

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

More
10 years 10 months ago - 10 years 10 months ago #120930 by Lefteris
Replied by Lefteris on topic Re: Label as title
You have to edit the menu item that points to the category you want the title in.
Then in the Page Display Options you choose to show the Page Heading and if you want the title to be different from the menu item title just enter a new title right below where it says "Page Heading".
When you save the menu item and refresh your page you should be able to see the title.

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