Not working sef_advanced_link.

Started by evpadallas, 28 September 2012, 13:08:13

Previous topic - Next topic
A financial contribution is greatly appreciated as a support, to help us to keep live the project.
If you like this project you can donate some piece of BitCoin to this address: bc1qy5tgq6tvrckac2a57unxvqcnxamrvhduve9sj9

evpadallas

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.

A financial contribution is greatly appreciated as a support, to help us to keep live the project.
If you like this project you can donate some piece of BitCoin to this address: bc1qy5tgq6tvrckac2a57unxvqcnxamrvhduve9sj9

federica

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

Al mondo ci sono 10 tipi di persone, quelli che hanno capito il codice binario e quelli che non l'hanno capito.
Informatizzati [url="https://informatizzati.org"]https://informatizzati.org[/url]
Stacca la spina [url="https://disconnessi.org"]https://disconnessi.org[/url]

evpadallas

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

federica

Hi evpadallas,
I understand. Thank you.
Al mondo ci sono 10 tipi di persone, quelli che hanno capito il codice binario e quelli che non l'hanno capito.
Informatizzati [url="https://informatizzati.org"]https://informatizzati.org[/url]
Stacca la spina [url="https://disconnessi.org"]https://disconnessi.org[/url]

A financial contribution is greatly appreciated as a support, to help us to keep live the project.
If you like this project you can donate some piece of BitCoin to this address: bc1qy5tgq6tvrckac2a57unxvqcnxamrvhduve9sj9

evpadallas

#4
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!

federica

Thank you very much evpadallas. Which rows have you modified?
I will add your code in the next abook version.
Al mondo ci sono 10 tipi di persone, quelli che hanno capito il codice binario e quelli che non l'hanno capito.
Informatizzati [url="https://informatizzati.org"]https://informatizzati.org[/url]
Stacca la spina [url="https://disconnessi.org"]https://disconnessi.org[/url]