Keyword

Displaying Category title

  • BrethrenArchives.Com
  • BrethrenArchives.Com's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 9 months ago #122640 by BrethrenArchives.Com
Displaying Category title was created by BrethrenArchives.Com
Here is the front page of my site . The "Discussion #1" item to the bottom right is a blog. On the front page I want to display the category to which it belongs, "Research Blog." However, I do not want to display the category for the "Books" article as it's parent category is "Uncategorized."

Thanks in advance,
A. Wayne Webb

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 9 months ago #122641 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Displaying Category title
Hello Wayne,

Please enable right clicking in your site.

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

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

  • BrethrenArchives.Com
  • BrethrenArchives.Com's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 9 months ago #122642 by BrethrenArchives.Com
Replied by BrethrenArchives.Com on topic Re: Displaying Category title
Sorry about that Krikor and it is deactivated.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 9 months ago #122643 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Displaying Category title
Safest way to achieve this is to use K2 Content modules if you do not want to edit each item's params seperately.

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

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

  • BrethrenArchives.Com
  • BrethrenArchives.Com's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 9 months ago #122644 by BrethrenArchives.Com
Replied by BrethrenArchives.Com on topic Re: Displaying Category title
Since I will be copying future blog entries from a template, it would likely be preferable to set each blog article itself. Set it up in the template and then copy it to a new blog entry.

So, how do I go about showing the "Research Blog" (category name) on the front page?

Thanks kindly,
A. Wayne Webb

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 9 months ago #122645 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Displaying Category title
You cannot do that directly to your template since in multi-category menu items, only one template will be loaded.

On the other hand you can achieve this by setting the params on each item (item view in category listings).

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

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

  • BrethrenArchives.Com
  • BrethrenArchives.Com's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 9 months ago #122646 by BrethrenArchives.Com
Replied by BrethrenArchives.Com on topic Re: Displaying Category title

Krikor Boghossian wrote: You cannot do that directly to your template since in multi-category menu items, only one template will be loaded.

On the other hand you can achieve this by setting the params on each item (item view in category listings).


Okay, so I changed the setting Item view options in category listings > Category from Inherit from category to Show. I did that both for the K2 item and for the K2 category. In the K2 category I made the change in both Item view options and Item view option in category listings.

I each time cleared the site cache and the browser cache.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 9 months ago #122647 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Displaying Category title
No need to edit the category as well. For the frontpage you can just edit that specific item.

I can see Published in Research Blog now under the Discussion #1 item.

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

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

  • BrethrenArchives.Com
  • BrethrenArchives.Com's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 9 months ago - 10 years 9 months ago #122648 by BrethrenArchives.Com
Replied by BrethrenArchives.Com on topic Re: Displaying Category title

Krikor Boghossian wrote: No need to edit the category as well. For the frontpage you can just edit that specific item.

I can see Published in Research Blog now under the Discussion #1 item.

Ahh, now I see the confusion between us. :cheer: Yes, "Research Blog" is listed under the K2 "Discussion #1" item. What I am going for is for the Research Blog category only, to have the category title appear above the date and time line of Discussion #1.

Cordially,
A. Wayne Webb

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 9 months ago #122649 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Displaying Category title
Aha! Ok,

That is a bit more complicated. You have to edit the category_item.php file.

This little snippet is the cateogry title
<?php if($this->item->params->get('catItemCategory')): ?>
			<!-- Item category name -->
			<div class="sans catItemCategory">
				<a href="<?php echo $this->item->category->link; ?>"><?php echo $this->item->category->name; ?></a>
			</div>
			<?php endif; ?>

Locate it and move it above the date which you will find by looking for this comment <!-- Date created -->

As for where to find these files and how to override them you need to read this post:
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.


Powered by Kunena Forum