Перейти к содержимому


Фотография
- - - - -

Item URL

url

Лучший Ответ SmetDenis , 03 March 2014 - 18:49

Hi

 

If you use item template e.g. modules\mod_zooitem\renderer\item\*.php

You don't need in  line

$item = $app->table->item->get('42'); // IT'S ONLY FOR EXAMPLE

because var $item already defined there

 

As result, you will have

$itemUrl = $app->route->item($item);
?>
<a class="urllink" href="<?php echo $itemUrl; ?>">
    // some HTML code
</a>

I check, this works fine.

Перейти к сообщению


  • Закрытая тема Тема закрыта
Сообщений в теме: 15

#1 P.K

P.K

Отправлено 27 February 2014 - 12:25

Hi

I just wanted the code to be used to get the URL in the item module. I want to use it to link to the item. 

thanks


  • 0

#2 SmetDenis

SmetDenis

Отправлено 28 February 2014 - 09:16

Hi,

 

Try to use this code

$item = $this->app->table->item->get('42'); // if we don't have $item variable than get it by ID=42
 
$itemUrl = $this->app->route->item($item);
echo '<a href='.$itemUrl.'>Item url</a>';

  • 0
JBZoo v4.0 и новый чудный мир Open Source GPL
Отключайте проверку лицензий как можно скорее!



— Есть два типа людей: Кто еще не делает бекапы и кто уже делает бекапы.


#3 P.K

P.K

Отправлено 28 February 2014 - 09:48

Hi

This seems to be giving the url of first cached product. As soon as the page refreshes the item changes but the url remains the same(as that of the first product). Some other crack required

thanks


  • 0

#4 SmetDenis

SmetDenis

Отправлено 28 February 2014 - 10:31

Hi

 

Do you use some SEF exts (Artio, sh404 etc) ?

Thanks


  • 0
JBZoo v4.0 и новый чудный мир Open Source GPL
Отключайте проверку лицензий как можно скорее!



— Есть два типа людей: Кто еще не делает бекапы и кто уже делает бекапы.


#5 P.K

P.K

Отправлено 28 February 2014 - 10:50

Hi

No i dont have any. Is it required for ZOO. I dint install them as i would be having a lot of links and it makes system slow 

thanks


  • 0

#6 SmetDenis

SmetDenis

Отправлено 28 February 2014 - 10:53

Hi

 

How much item links you want create for one time (on one page)?

 

Thanks.


  • 0
JBZoo v4.0 и новый чудный мир Open Source GPL
Отключайте проверку лицензий как можно скорее!



— Есть два типа людей: Кто еще не делает бекапы и кто уже делает бекапы.


#7 P.K

P.K

Отправлено 28 February 2014 - 11:04

A single page has about 40 links. and they keep on changing from one page to other

 

Actually i wish to use the link for anchor tag for the item module. If it is difficult to get url then we could take it from the item link element

thanks


  • 0

#8 SmetDenis

SmetDenis

Отправлено 28 February 2014 - 11:46

40 links is not a lot for links generated.

I think, you can not worry about it.


For example.

http://jbzoo.ru/docs - is our new russian JBZoo website. And on this page you can see about 60 links to items.

We don't use any cache. it's works fine.

 

PS Soon we will release new website in English.


  • 0
JBZoo v4.0 и новый чудный мир Open Source GPL
Отключайте проверку лицензий как можно скорее!



— Есть два типа людей: Кто еще не делает бекапы и кто уже делает бекапы.


#9 P.K

P.K

Отправлено 01 March 2014 - 09:00

Hi 

The problem here is to how to get the url in the item module so that i could set up an anchor tag. The above method dint work well. Pls suggest some other method

thanks


  • 0

#10 SmetDenis

SmetDenis

Отправлено 01 March 2014 - 18:59

Hi

 

Getting url via helper route is one correct method for creating url to item.

Can you give me your variant of code, which doesn't work correctly ?

 

Thanks


  • 0
JBZoo v4.0 и новый чудный мир Open Source GPL
Отключайте проверку лицензий как можно скорее!



— Есть два типа людей: Кто еще не делает бекапы и кто уже делает бекапы.






Темы с аналогичным тегами url

Click to return to top of page in style!