40 Posts
yoyoxp
4 years ago
1
Topic

Hi all

I have a List & Search Type for Search Results which use multiple different content types and menu options. Because I also use different SEF menu variations in my site, the default option to inherit the menu item does not work.

The solution, as documented here:
https://www.seblod.com/resources/manuals/intermediate/creating-links

Seems perfect. What I have done is created two simple Text Fields with a default value of true. Then as per documentation I use JSON structure:
{"my_custom_field_id": "true"}=<menu item>

I then add this custom field to the List view.

This should work, but it does not. Digging deeper and debugging the code, I found that within the following code file:
./plugins/cck_field_link/content/content.php

From line #290 or therabouts the JSON is decoded and a check is made based on the above. My issue here is, that any of my Fields as associated to my list do not have a value field, only a default value. This means the following code will always fail:
if ( isset( $fields[$k] ) && $fields[$k]->value == $v )

Simply because we never have a value. I change the check property from value, to defaultvalue and success my custom Menu Mappings work!

I attach a screenshot of the debugger so you can get a better idea what I mean. None of the field objects have a value property at this point. I don't know if this is an issue with my configurations, or something else.

Screenshot here: https://i.imgur.com/c62V7m3.png


Best regards
Nick

Get a Book for SEBLOD
40 Posts
yoyoxp
4 years ago
0
Level 1

I managed to solve it, the following worked for me:

1. Add art_catid field to search list

2. Use the mapping based on category id to find correct menu item i.e: {"catid": "<id>"}="<menu_id>"

This works fine and means I can filter and route search result properly. My initial suspicions were wrong there does not appear to be any issues with code

Nick

Get a Book for SEBLOD