- Posts: 69
COMMUNITY FORUM
How to show category desciprtion in a module pos.
- Uldis
-
Topic Author
- Offline
- Senior Member
Less
More
12 years 6 months ago #106781
by Uldis
How to show category desciprtion in a module pos. was created by Uldis
Hello,
Is it somehow possible to get category description in a module position ?
My site structure is built like this
Fruit
-Apples
- - Green Apples
- - Red Apples
Category Apples, has "Category Description" turned on
I'm having problems with Categories "Green Apples and Red Apples", these categories have "Category Description" turned off, but they still need to display category description, only in different position.
I tried using extra fields and plugin k2_spilt_content, but I can only get description (from extra fields) in item view
Is it somehow possible to get category description in a module position ?
My site structure is built like this
Fruit
-Apples
- - Green Apples
- - Red Apples
Category Apples, has "Category Description" turned on
I'm having problems with Categories "Green Apples and Red Apples", these categories have "Category Description" turned off, but they still need to display category description, only in different position.
I tried using extra fields and plugin k2_spilt_content, but I can only get description (from extra fields) in item view
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
12 years 6 months ago #106782
by william white
Replied by william white on topic Re: How to show category desciprtion in a module pos.
I would start with something like
<?php if($this->params->get('catDescription')): ?>
<!-- Category description -->
<p><?php echo $this->category->description; ?></p>
<?php endif; ?>
(from category.php)
You are having a scope issue
<?php if($this->params->get('catDescription')): ?>
<!-- Category description -->
<p><?php echo $this->category->description; ?></p>
<?php endif; ?>
(from category.php)
You are having a scope issue
Please Log in or Create an account to join the conversation.
- Uldis
-
Topic Author
- Offline
- Senior Member
Less
More
- Posts: 69
12 years 6 months ago - 12 years 6 months ago #106783
by Uldis
Replied by Uldis on topic Re: How to show category desciprtion in a module pos.
I actually tried this code before.
I tried putting it in mod_k2_Tools (custom code mode)
But once I enable this mod, website displays only white page.
Also "Category Description" is turned of in this category, this is the reason I wanted to display category description in a module position, so category description would get displayed anyway
What is a scope issue ?
I tried putting it in mod_k2_Tools (custom code mode)
But once I enable this mod, website displays only white page.
Also "Category Description" is turned of in this category, this is the reason I wanted to display category description in a module position, so category description would get displayed anyway
What is a scope issue ?
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
12 years 6 months ago #106784
by william white
Replied by william white on topic Re: How to show category desciprtion in a module pos.
if u are getting a white page, turn error reporting on highest and see what the error is and go from there
scoping = what is the current object, how do you address it, and how do you address things that are not in sccope
scoping = what is the current object, how do you address it, and how do you address things that are not in sccope
Please Log in or Create an account to join the conversation.
- Uldis
-
Topic Author
- Offline
- Senior Member
Less
More
- Posts: 69
12 years 6 months ago - 12 years 6 months ago #106785
by Uldis
Replied by Uldis on topic Re: How to show category desciprtion in a module pos.
The returned error was - Fatal error: Using $this when not in object context in /tmp/tmptqy0BF on line 1
Guess I can't put that code in module position !?
Probably my idea isn't the best, but I've been thinking for quite a while on how to do that , I only post in forum as a last resort.
In this situation website design is needlessly complex. I have a fallback plan in case I can't get category description in a module position, but things would be a lot easier if I could.
In categories Fruit and Fruit->Apples I have a secondary menu module and category description
In category Green Apples I need to turn off secondary menu and move category description to secondary menu position
When going in further, viewing Green Apple 1 item I will also need category description (From Green Apples)
I don't like this construction, but In this case I can't change it.
I know that I could create an html module for each category and display category description that way, but It would be just 1 more thing to manage, besides there will be 3 languages, which means a lot of modules.
So I thought that getting category description in module position would be the best solution
Guess I can't put that code in module position !?
Probably my idea isn't the best, but I've been thinking for quite a while on how to do that , I only post in forum as a last resort.
In this situation website design is needlessly complex. I have a fallback plan in case I can't get category description in a module position, but things would be a lot easier if I could.
In categories Fruit and Fruit->Apples I have a secondary menu module and category description
In category Green Apples I need to turn off secondary menu and move category description to secondary menu position
When going in further, viewing Green Apple 1 item I will also need category description (From Green Apples)
I don't like this construction, but In this case I can't change it.
I know that I could create an html module for each category and display category description that way, but It would be just 1 more thing to manage, besides there will be 3 languages, which means a lot of modules.
So I thought that getting category description in module position would be the best solution
Please Log in or Create an account to join the conversation.
- Uldis
-
Topic Author
- Offline
- Senior Member
Less
More
- Posts: 69
12 years 6 months ago #106786
by Uldis
Replied by Uldis on topic Re: How to show category desciprtion in a module pos.
bump
Please Log in or Create an account to join the conversation.
- Uldis
-
Topic Author
- Offline
- Senior Member
Less
More
- Posts: 69
12 years 6 months ago #106787
by Uldis
Replied by Uldis on topic Re: How to show category desciprtion in a module pos.
Can no one really tell me how to get category description in a module position please ?
Please Log in or Create an account to join the conversation.
- Matbev
-
- Offline
- New Member
Less
More
- Posts: 8
11 years 1 month ago #106788
by Matbev
Replied by Matbev on topic Re: How to show category desciprtion in a module pos.
I also need to display k2 descirption (and image if possible) in a module.
Help will be appreciated.
Help will be appreciated.
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
11 years 1 month ago #106789
by Lefteris
Replied by Lefteris on topic Re: How to show category desciprtion in a module pos.
@Matbev
Unfortunately this is not available in K2 modules. I suggest that you search for a third-party module that might do what you need.
Unfortunately this is not available in K2 modules. I suggest that you search for a third-party module that might do what you need.
Please Log in or Create an account to join the conversation.