Vox Populi(x) forum

Alexandria Book Library => Errori (Bugs) => Topic started by: evpadallas on 28 September 2012, 13:08:13

Title: Not working sef_advanced_link.
Post by: evpadallas on 28 September 2012, 13:08:13
Hello
Thanks for the great component.
In Joomla! there is such a feature as a take away ItemID from SEF links. Ie instead 1-cat/2-item.html doing cat / item.html.
To do this, insert the following code
Code (xml) Select
<field name="sef_advanced_link"
type="radio" default="0"
label="Sef Advanced Mode"
description="Remove ItemID from Content URL?">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>


in /administrator/components/com_abook/config.xml

In your component, this function does not work. Please check and correct as possible.

Thank you!

P.S.
in /component/views/view.html.php

this

Code (php) Select
if ($category->id!="root"){
while($category->id > 1){
$path[] = array('title' => $category->title, 'link' => AbookHelperRoute::getCategoryRoute($category->id.':'.$category->alias));
$category = $category->getParent();
}
if ($category!=''){
$path = array_reverse($path);
foreach ($path as $item){
$pathway->addItem($item['title'], $item['link']);
}
}
}
$pathway->addItem($this->book->title);


replace to this
Code (php) Select

if ($category->id != "root"){
while($category->id > 1){
$path[] = array('title' => $category->title, 'link' => AbookHelperRoute::getCategoryRoute($category->id.':'.$category->alias));
$category = $category->getParent();
}
}

if ($category != ''){
$path = array_reverse($path);
foreach ($path as $item){
$pathway->addItem($item['title'], $item['link']);
}
}

if ($this->params->get( 'breadcrumb' ) == 2) {
$pathway->addItem($this->book->title);
}


This is a fix to display the sequence of categories.

Thank you again.
Title: Re: Not working sef_advanced_link.
Post by: federica on 30 September 2012, 18:06:35
Hi evpadallas,
thanks for your interest!
I try to set sef_advanced_link option to 1 (router.php) but there is a problem with authors sef links.

Which problem solves the second piece of code? There is a problem with a path generation?

Bye

Title: Re: Not working sef_advanced_link.
Post by: evpadallas on 01 October 2012, 10:59:05
Yes, it is correct to build breadcrumbs.
At your option, if you are in category 3, the path is constructed such "cat1> cat2> cat3", and if I go into the book, the way to build such a "cat1> cat2> bookname> bookname". In my version when you are in the category are all exactly the same, but the transition to the book, the path is constructed so: cat1> cat2> cat3> bookname
Title: Re: Not working sef_advanced_link.
Post by: federica on 04 October 2012, 16:41:34
Hi evpadallas,
I understand. Thank you.
Title: Re: Not working sef_advanced_link.
Post by: evpadallas on 06 October 2012, 06:26:06
Hello federica,
I'm a little corrected file router and now everything works. File as an attachment. Please, use it in your component. It is absolutely free :D.
Thank you!
Title: Re: Not working sef_advanced_link.
Post by: federica on 07 October 2012, 12:54:27
Thank you very much evpadallas. Which rows have you modified?
I will add your code in the next abook version.