Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Page control/function for getting current directory?

Go to End

2 Posts   2015 Views

Samba Sam

Community Member, 85 Posts

24 November 2009 at 3:00pm

Edited: 24/11/2009 3:00pm

I am customizing the $ for my template. I need to get the current directory for calling up the action for the search form.

As in...
<form id="SearchForm_SearchForm" action="/currentdirectory/SearchForm" method="get" enctype="application/x-www-form-urlencoded">

Is there a page control for getting the current directory/page. If not, what would be the alternative (e.g., page controller function)?


Samba Sam

Community Member, 85 Posts

25 November 2009 at 11:20am

Edited: 25/11/2009 11:21am

I should have looked at the sapphire template before posting.

I got the search form working by using $FormAttibutes. The sapphire SearchForm template has some extra tags that I don't need (e.g., fieldset and legend).

So, I created a file with the following in the root of my template folder, which includes a bit of javascript to remove the "search" text when the search box is clicked on.

<form $FormAttributes >
<input type="text" name="Search" id="search" value="Search.." onfocus="if(this.value == 'Search..') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search..';}"/>
<input class="action" id="SearchForm_SearchForm_action_results" type="submit" name="action_results" value="GO" title="GO" />

And used $SearchForm in my template to call it up.