Keyword

K2 - where's Linked Titles can be disabled?

More
4 years 9 months ago #172570 by Head
In Joomla menu item options we can disable linking title to current page - see screen. How to disable it for K2?
So far i found this in my template code
<h1><?php echo $this->escape($this->params->get('page_title')); ?></h1>
so it's generated straight with link which is not what I need.
Any suggestions on K2 settings or code alteration?
Attachments:

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

More
4 years 8 months ago #172590 by Head
It's weird - i can see reply when logged off, and once i login it's not here. Anyway it's wrong answer - i don't need to hide menu item, i need to disable link on page title.

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

More
4 years 8 months ago #172626 by JoomlaWorks
Replied by JoomlaWorks on topic K2 - where's Linked Titles can be disabled?
This is an edge case really. It may exist in Joomla Articles, but a whole bunch of other weird stuff do too.

K2 is based on common sense configurations.

If you fall into an edge case, you can just utilize K2 template overriding to modify and remove the link for K2 item titles.

First off, basic K2 templating: getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

Then you must edit category_item.php, locate where the title is output (it should be wrapped by an <a> tag), remove the <a> tag and save. Links will now be gone from the category listings.

If you need to do this for select categories, you can create a 2nd sub-template group inside your Joomla template, for K2 overrides (e.g. /templates/YOUR_TEMPLATE/html/com_k2/NoLinksForItems/category_item.php). Then head over to your categories and select the "NoLinksForItems" subtemplate to use. Done.

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

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

More
4 years 8 months ago #172628 by Head
Sorry, i thought i was clear enough - there's no <a> tag in template,
it's core-related, as template uses $this->params->get('page_title') which returns title already wrapped into anchor.

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

More
4 years 8 months ago - 4 years 8 months ago #172629 by JoomlaWorks
Replied by JoomlaWorks on topic K2 - where's Linked Titles can be disabled?
This is the page title and it's not linked by default. So what's the issue?

Edit: why would the page title be linked either way... (doesn't make sense)

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Last edit: 4 years 8 months ago by JoomlaWorks.

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

More
4 years 8 months ago - 4 years 8 months ago #172633 by Head
On affected site it comes linked with no <a> templated. Can you please point me to related file in core?

UPD. Actually i'll also check ALL template files, maybe template developer made it wrong way...
Last edit: 4 years 8 months ago by Head. Reason: Update

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

More
4 years 8 months ago #172634 by Head
prntscr.com/ojdzxy

Links to items is ok, but i was required to disable category title as found no other solution so far.

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

More
4 years 8 months ago #172639 by JoomlaWorks
Replied by JoomlaWorks on topic K2 - where's Linked Titles can be disabled?
Read this to understand K2 templating: getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

As you said, perhaps some HTML ended up in the wrong place by your template developer.

Fotis / 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