All questions about EDocman extension

SOLVED: Link to go up to parent category

More
9 years 11 months ago - 9 years 11 months ago #44956 by Till
Hello Tuan,

first let me say, that I really like your component EDocman. Does just what I need it to do and such a nice code in the frontend.

I have just one simple question (I searched if the answer already existed, but didn't find anything):

If you are in a subcategory, do you have an option to show some link to go up to the parent category? I didn't find anything in the backend configuration. Also I couldn't find any such link in your demo pages. So I surmise you don't have it implemented.

So my - maybe not so simple - next question is: I want to integrate such a link in an override in "table.php". What would be the code for it? And I don't mean something like "history.go(-1)" :P
Last edit: 9 years 11 months ago by Till. Reason: Marking as solved

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

More
9 years 11 months ago #44982 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Link to go up from subcategory to parent category
Hi Till

Do you have breadcrumb module loaded on your site ? If you loaded that module into your site template (hope you know how to do that), you will be able to navigate to parent categories easily !

Tuan
The following user(s) said Thank You: Till

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

More
9 years 11 months ago - 9 years 11 months ago #45025 by Till
Yes, I do know how to integrate the breadcrumbs module. Pity that my client does not want it to be present on his website.

But still, thank you for your hint! I will look into the breadcrumbs module and see if I can re-use some of that code to generate such a "Up to parent category" link.

Update: My mother always told me to think before talking. Well, she was right... Here is the very simple code. Put it where you want the link to appear.
Code:
<?php if ($this->category->parent_id != 0) { ?> <a href="<?php echo JRoute::_('index.php?option=com_edocman&view=category&id='.$this->category->parent_id.'&layout=table&Itemid='.$this->Itemid); ?>">YOUR_LINKTEXT</a> <?php } ?>
Last edit: 9 years 11 months ago by Till.

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

More
9 years 11 months ago #45065 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Link to go up from subcategory to parent category
Yeah, that's a very simple solution and it works. Breadcrumb will make it more flexible (allowing to navigate to any parent category - in case you have categories in different levels). But I guess the above code is OK for your usecase !

Tuan

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

Moderators: Mr. Dam