Support Forums - Classified Ads Script Osclass

Osclass theme support => Beta Osclass Theme => Topic started by: Andrey on February 04, 2020, 10:47:39 AM

Title: “Category” as a link
Post by: Andrey on February 04, 2020, 10:47:39 AM
Hello! Like in Beta Theme on the announcement page, display “Category” as a link. Like in Violet Theme
Violet
(https://do-mos.ru/Violet.JPG)
Beta
(https://do-mos.ru/Beta.JPG)



Title: Re: “Category” as a link
Post by: MB Themes on February 04, 2020, 12:24:05 PM
@Olime
https://docs.osclasspoint.com/hitems-php

Probably you would go with code:
Code: [Select]
<a href="<?php echo osc_item_category_url(); ?>"><?php echo osc_item_category()['s_name']; ?></a>
if osc_item_category does not return anything, try osc_item_category_name
if osc_item_category_url does not exists, try osc_search_url('page' => 'search', 'category' => osc_item_category_id())
Title: Re: “Category” as a link
Post by: Andrey on February 04, 2020, 01:06:08 PM
The page does not load with this code. White background. In the original view on the code, the page ends.
In Violet theme, your code works. No Beta
Title: Re: “Category” as a link
Post by: MB Themes on February 04, 2020, 03:15:49 PM
@Olime
Read whole message. Check your error log.
Title: Re: “Category” as a link
Post by: Andrey on February 04, 2020, 04:22:14 PM
[04-Feb-2020 18:15:56 Europe/Moscow] PHP Fatal error:  Call to undefined function osc_item_category_url() in /home/p/www/public_html/oc-content/themes/beta/item.php on line 13

Category without a link is added there
Title: Re: “Category” as a link
Post by: MB Themes on February 04, 2020, 05:53:20 PM
So you see function does not exists, you have alternatives in my post, you must be more proactive when doing customization in your site and test all possibilities.
Title: Re: “Category” as a link
Post by: Andrey on February 04, 2020, 06:04:57 PM
I tried everything, even this
<a href="<?php echo bet_item_category_url(osc_item_category_id()) ; ?>"></a>
Title: Re: “Category” as a link
Post by: MB Themes on February 04, 2020, 06:42:41 PM
Code: [Select]
osc_search_url('page' => 'search', 'category' => osc_item_category_id())
Title: Re: “Category” as a link
Post by: Andrey on February 04, 2020, 07:39:25 PM
Does not work

[04-Feb-2020 21:21:27 Europe/Moscow] PHP Parse error:  syntax error, unexpected '=>' (T_DOUBLE_ARROW) in /home/p/www/public_html/oc-content/themes/beta/item.php on line 31
Title: Re: “Category” as a link
Post by: MB Themes on February 05, 2020, 09:07:18 AM
@Olime
Code: [Select]
osc_search_url(array('page' => 'search', 'category' => osc_item_category_id()))
Title: Re: “Category” as a link
Post by: Andrey on February 05, 2020, 10:11:07 AM
Thank you so much for the quick help. Everything works fine, even the city finds it through this code. Why there used to be an error, that I wrote the code wrong.
 Thank you  :)
Title: Re: “Category” as a link
Post by: Andrey on February 05, 2020, 06:23:16 PM
Super