- Posts: 22
COMMUNITY FORUM
Label as title
- cyfcaloryfrio
-
Topic Author
- Offline
- Junior Member
Less
More
11 years 5 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.
Thank you very much.
Attachment not found
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
11 years 5 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
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 22
11 years 5 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
-
- Visitor
11 years 5 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.
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
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 22
11 years 5 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
-
- Visitor
11 years 5 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 codeChange the <div class="componentheading"> to <h1>.
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; ?>
Please Log in or Create an account to join the conversation.
- cyfcaloryfrio
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 22
11 years 5 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!!
The code is great!!
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
11 years 5 months ago - 11 years 5 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.
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.
Please Log in or Create an account to join the conversation.