starhawk85 Posted July 5, 2012 Share Posted July 5, 2012 okay i may be completely in the wrong area, need some help if anyone could. My code <option class="selectCategory" value="{$searchCategory.categoryId}" {if $searchCategory.categoryId==$categoryId}selected="selected"{/if}>{$searchCategory.name}</option> I want to make this into a regular old Link... such as click here type thing. thanks in advance. Quote Link to comment Share on other sites More sharing options...
Mahngiel Posted July 5, 2012 Share Posted July 5, 2012 What difficulty are you having ? Quote Link to comment Share on other sites More sharing options...
starhawk85 Posted July 5, 2012 Author Share Posted July 5, 2012 I am unsure how to make this into a link, without the dropdown. i want to get rid of the select options and just have a plain link. but still need if statement to show or hide here is the whole code <select name="categoryId" id="searchEngineCategoryId"> <option value="0">{'extraFieldSearch_all_categories'|lang}</option> {foreach from=$searchCategories value=searchCategory} <option class="selectCategory" value="{$searchCategory.categoryId}" {if $searchCategory.categoryId==$categoryId}selected="selected"{/if}>{$searchCategory.name}</option> {foreach from=$searchCategory.subcategories value=subcategory} <option class="selectSubcategory" value="{$subcategory.categoryId}" {if $subcategory.categoryId == $categoryId}selected="selected"{/if}> {$subcategory.name}</option> {/foreach} <option class="space" value=""></option> {/foreach} </select> Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted July 5, 2012 Share Posted July 5, 2012 What is that written in? Is it a templating system or what? Quote Link to comment Share on other sites More sharing options...
starhawk85 Posted July 5, 2012 Author Share Posted July 5, 2012 a TPL file, its main frame is php. Quote Link to comment Share on other sites More sharing options...
Mahngiel Posted July 5, 2012 Share Posted July 5, 2012 Well, let's explore your code then, shall we? You have a few things defined in your <option>s that are going to be usable. What you need to determine is which parts of those are going to be useful to build your links. What are your URI paths? To make: example.com/search?category=XXX&term=XXX Break down your code <option class="selectCategory" value="{$searchCategory.categoryId}" {if $searchCategory.categoryId==$categoryId}selected="selected"{/if}>{$searchCategory.name}</option> and plug in the pieces <a href=example.com/search?category=<? something here; ?>&term=<? something here; ?> Quote Link to comment Share on other sites More sharing options...
starhawk85 Posted July 5, 2012 Author Share Posted July 5, 2012 i have tried something like this <a href=searchCategory.categoryId==1=selected&term=category.name> Advanced search</a> no luck, generally the same idea of what im looking for though. i may be missing something or overlooking. Quote Link to comment Share on other sites More sharing options...
Mahngiel Posted July 5, 2012 Share Posted July 5, 2012 Well, what's the full path address to your search function? You kind need that part too. But define "no luck" because I do not have wizard powers of clairvoyance. Quote Link to comment Share on other sites More sharing options...
starhawk85 Posted July 5, 2012 Author Share Posted July 5, 2012 HA HA HA sorry, yeah no luck defined is i get a pretty little link but get an error page. the drop down menu allows to show or hide advanced search options not be directed to a new page. if that makes sence Quote Link to comment Share on other sites More sharing options...
Mahngiel Posted July 5, 2012 Share Posted July 5, 2012 C'mon man, work with me here. What does the link look like, what do you want it to look like? Quote Link to comment Share on other sites More sharing options...
starhawk85 Posted July 5, 2012 Author Share Posted July 5, 2012 the link looks like a link just like this >>>> Advanced search that's it. Quote Link to comment Share on other sites More sharing options...
starhawk85 Posted July 5, 2012 Author Share Posted July 5, 2012 all i want it to do is to show the advanced search options without the drop down menu. nothing more nothing less. same fuctionallity as the drop down just no options to scroll through just a plain ol link Quote Link to comment Share on other sites More sharing options...
Mahngiel Posted July 5, 2012 Share Posted July 5, 2012 You're getting an error page because your link tag is incorrect. I have asked you to post code, no text. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted July 5, 2012 Share Posted July 5, 2012 How do you figure simply changing the options of a select element to a bunch of links is going to have the same functionality? Quote Link to comment Share on other sites More sharing options...
Mahngiel Posted July 5, 2012 Share Posted July 5, 2012 Methinks it's a jumpbox, Pika, not a search input Quote Link to comment Share on other sites More sharing options...
starhawk85 Posted July 5, 2012 Author Share Posted July 5, 2012 its not a bunch of links its one single link. I only have one option, but this is the only way i know how to get it to work so was really hoping i could just do a single link for the advanced search options Quote Link to comment Share on other sites More sharing options...
Mahngiel Posted July 5, 2012 Share Posted July 5, 2012 This is your last chance with me, and I'll give you every opportunity to help me help you. A: What values are you getting from the script to put into the current <option> ? B: Where does the link anchor to? C: What is the current HTML output? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted July 5, 2012 Share Posted July 5, 2012 The question remains largely the same. Quote Link to comment Share on other sites More sharing options...
starhawk85 Posted July 5, 2012 Author Share Posted July 5, 2012 it is entirely one page, code is as follows. {if empty($edit)} <div class="search_cat_place"> <span class="text_search">{'extraFieldSearch_category'|lang}</span> <select name="categoryId" id="searchEngineCategoryId"> <option value="0">{'extraFieldSearch_all_categories'|lang}</option> {foreach from=$searchCategories value=searchCategory} <option class="selectCategory" value="{$searchCategory.categoryId}" {if $searchCategory.categoryId==$categoryId}selected="selected"{/if}>{$searchCategory.name}</option> {foreach from=$searchCategory.subcategories value=subcategory} <option class="selectSubcategory" value="{$subcategory.categoryId}" {if $subcategory.categoryId == $categoryId}selected="selected"{/if}> {$subcategory.name}</option> {/foreach} <option class="space" value=""></option> {/foreach} </select> <a href=class="selectCategory" value="{$searchCategory.categoryId}" {if $searchCategory.categoryId==$categoryId}selected="selected"{/if}> Advanced search</a> </div> <div class="din_search_engine"> {/if} {if !empty($extraFields)} <style> {literal} .searchModule { padding: 0px 5px; width: 200px; line-height: 1.8; position: absolute; } {/literal} </style> {if empty($edit)}<div style="position:relative">{/if} {foreach from=$extraFields value=extraField} {if !empty($searchEngineSettings.fields[$extraField.fieldId])} {assign var="fieldSetting" value=$searchEngineSettings.fields[$extraField.fieldId]} {else} {assign var="fieldSetting" value=""} {/if} {if !empty($edit) || !empty($fieldSetting.display)} <div class="searchModule" fieldId="{$extraField.fieldId}" style="{if $fieldSetting}left: {$fieldSetting.left}px; top: {$fieldSetting.top}px; width: {$fieldSetting.width}px; height: {$fieldSetting.height}px;{/if}{if empty($fieldSetting) || empty($fieldSetting.display)}display:none;{/if}"> <span class="text_search">{$extraField.name}</span> <div> {assign var="fieldName" value="extraField[$extraField.fieldId]"} {if $extraField.type == "checkbox"} {assign var="fieldName" value=$fieldName|cat:'[]'} {/if} {switch from=$extraField.type} {case value="textarea"} <input type="text" name="{$fieldName}"/> {case value="text"} <input type="text" name="{$fieldName}"/> {case value="select"} <select name="{$fieldName}"> <option value="">{'extraFieldSearch_select_option'|lang}</option> {foreach from=$extraField.options value=option} <option value="{$option.value}">{$option.label}</option> {/foreach} </select> {case value="radio"} {foreach from=$extraField.options value=option} <input type="radio" name="{$fieldName}" value="{$option.value}"/> {$option.label} {/foreach} {case value="checkbox"} {foreach from=$extraField.options value=option name=loop} <span style="width:180px;display:block;float:left"><input type="checkbox" name="{$fieldName}" value="{$option.value}"/> {$option.label}</span> {/foreach} {case value="range"} {'extraFieldSearch_from'|lang} <input type="text" name="{$fieldName}[from]" size="5"/> {'extraFieldSearch_to'|lang} <input type="text" name="{$fieldName}[to]" size="5"/> {case} {/switch} </div> <div style="clear:both"></div> </div> {/if} {/foreach} {/if} {if empty($edit)}</div>{/if} as you can see the linking is simply all on the same file and or page. this is where everything that would pertain to linking happens, for this option selection. Quote Link to comment Share on other sites More sharing options...
starhawk85 Posted July 5, 2012 Author Share Posted July 5, 2012 I dont see how it is so very hard for you guys to understand that all i am lookng to do is take the options list and make it into a link there is simply one option. not sure how im confusing you. Quote Link to comment Share on other sites More sharing options...
Mahngiel Posted July 5, 2012 Share Posted July 5, 2012 I dont see how it is so very hard for you guys to understand that all i am lookng to do is take the options list and make it into a link there is simply one option. not sure how im confusing you. The problem is you had not given us what we need to help you until your last post. Now, we are able to tell you that your anchor tag is incorrectly created. You need to correctly create the HTML anchor element. Give this a read. http://www.tizag.com/htmlT/links.php Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted July 5, 2012 Share Posted July 5, 2012 I dont see how it is so very hard for you guys to understand that all i am lookng to do is take the options list and make it into a link there is simply one option. not sure how im confusing you. Really? You didn't post PHP code, and you didn't post html markup. You posted a small amount of crap from an unspecified, templated mess and expect everyone to know what the hell it is, what it does, how it's rendered, what is actually in the form elements and how it gets processed when submitted. Then you were utterly shocked when nobody could tell you what you wanted to know without further information? I don't see what's so hard for you to understand about how to effectively ask a question in a manner such that others have enough information to answer it appropriately without having to pry the necessary details out of you. Quote Link to comment Share on other sites More sharing options...
starhawk85 Posted July 5, 2012 Author Share Posted July 5, 2012 so after everything this is the closest thing that works <a class="selectCategory" value="{$searchCategory.categoryId}" {if $searchCategory.categoryId==$categoryId}selected="selected"{/if}>{$searchCategory.name}</a> only problem is currently HA HA HA its not clickable but it does hover. The alternate is <a href="#" class="selectCategory" value="{$searchCategory.categoryId}" {if $searchCategory.categoryId==$categoryId}selected="selected"{/if}>{$searchCategory.name}</a> these seem to be the only things that seem to be close enough to work... I am still attemting to figure this out, PS Checked out the website. great information and learned a few things i did not know, I dont think this would apply to me but i could be mistaken, if so inform me as to how i could implement this to work for my self. I will keep updated on my progress. If any further ideas or if a solution might just be found please let me know Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.