This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

Andrey

  • ****
  • 157 posts
“Category” as a link
« 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

Beta





*

MB Themes

Re: “Category” as a link
« Reply #1 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())
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Andrey

  • ****
  • 157 posts
Re: “Category” as a link
« Reply #2 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
« Last Edit: February 04, 2020, 01:47:40 PM by Olime Olime »

*

MB Themes

Re: “Category” as a link
« Reply #3 on: February 04, 2020, 03:15:49 PM »
@Olime
Read whole message. Check your error log.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Andrey

  • ****
  • 157 posts
Re: “Category” as a link
« Reply #4 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
« Last Edit: February 04, 2020, 04:34:53 PM by Olime Olime »

*

MB Themes

Re: “Category” as a link
« Reply #5 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.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Andrey

  • ****
  • 157 posts
Re: “Category” as a link
« Reply #6 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>

*

MB Themes

Re: “Category” as a link
« Reply #7 on: February 04, 2020, 06:42:41 PM »
Code: [Select]
osc_search_url('page' => 'search', 'category' => osc_item_category_id())
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Andrey

  • ****
  • 157 posts
Re: “Category” as a link
« Reply #8 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

Marked as best answer by olime.olime on February 05, 2020, 03:00:09 PM
*

MB Themes

Re: “Category” as a link
« Reply #9 on: February 05, 2020, 09:07:18 AM »
@Olime
Code: [Select]
osc_search_url(array('page' => 'search', 'category' => osc_item_category_id()))
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Andrey

  • ****
  • 157 posts
Re: “Category” as a link
« Reply #10 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  :)
« Last Edit: February 05, 2020, 10:48:29 AM by Olime Olime »

*

Andrey

  • ****
  • 157 posts
Re: “Category” as a link
« Reply #11 on: February 05, 2020, 06:23:16 PM »
Super
« Last Edit: February 06, 2020, 01:47:57 AM by Olime Olime »