1283 Posts
Bucklash
8 years ago
0
Topic

Hi folks

EDIT: I was thinking the wrong way and have now solved my conundrum... Add the desired field to search form, set live to value in url (id) and voila....
Is it possible to grab a value from the url on the first search, bypassing the need for a Search Button?
AIM: Users will create categories on the front end. Using the afterstore field I aim to create a menu item which points to that category.
(I can do this with a Joomla menu item but I would prefer to sty in the land of Seblod where possible and display the category using List & Search).
METHOD: In my Search Form, I have these fields:
cck_storage_location {type: select - dynamic, live value: joomla_category"}
cat_id {type: text, live: url(variable), live value: variable(id)}
cat_search_query {type: search query}
The sql for the search query is this:
SELECT title, id
         FROM #__categories
         WHERE [MATCH]id||$uri->getValue('cat_id')[/MATCH]
This works great in conjunction with the Search Button, but I can I load the page with this value already assigned?
FYI...
The link created by a List & Search type is like this:
index.php?option=com_cck&view=list&search=my_search_type&task=search
The url would look like this:
index.php?option=com_cck&view=list&search=my_search_type&task=search&itemid=115
Using afterstore I append the link with the id of the category just created:
index.php?option=com_cck&view=list&search=my_search_type&task=search&id=20
The url now looks like this:
index.php?option=com_cck&view=list&search=my_search_type&task=search&id=20&itemid=115

Bucklash

Get a Book for SEBLOD