How can I allow end users specify a query in Contribute or Dreamweaver?
March 3, 2009 2:43 PM   Subscribe

How can I set up a Dreamweaver Template so that a user can enter a variable to get a custom recordset?

I hand roll my Web pages, but there is a Dreamweaver site which has much database driven content. Many users will be updating it either in Dreamweaver or in Contribute. This is in .asp classic. There are panels that get recordset data from a table. I would like for a user to be able to add a record id into an editable region of the template so that he or she will get the correct query results without having to go to bindings, or any tasks more complicated for the average user. They know the record ids so they can copy and paste.
What I am looking for is an end user - even in contribute creating a page from a template, adding a number in the recordid editable region so that the query queries the database for the correct data.

Now of course, I *can* use the urlstring, - "page.asp?recordid=2" for example, but it is also a requirement that the .asp pages be named normal names (newyorkoffice.asp, somothercityoffice.asp) etc., etc.

I would assume this is easy, you can make a meta tag as editable, but for some reason, I am at a loss on how to do this. Nothing shows up in Google, is this possible, should I be looking for other alternatives. Keep in mind that since the site is in DW and the db is SQLServer and there is a huge .asp classic codebase, even if it isn't the most elegant solution, if there is a way to NOT re-jigger the entire site from scratch, I am all for it.
posted by xetere to Computers & Internet (6 answers total)
 
I don't know dreamweaver, and I'm not entirely sure I follow your description of what you envision the user doing (are you talking about site authors or end users?) -- but what you're looking for is a POST (passing a variable using a form element) as opposed to a GET (passing it using a url parameter.)

In other words your page would have something like
<form action="whicheveroffice.asp">
Record ID: <input type="text" name="recordid">
<input type="submit">
</form>
... which on submitting the form would be (for your purposes) equivalent to directly calling whicheveroffice.asp?recordid=(whatever they put in the text field).
posted by ook at 3:00 PM on March 3, 2009


maybe you could put at snippet of ASP code in an editable region in the HEAD of the template...

<% theVar="abc123" %>

and then modify the SQL so it would read

<%
sql="SELECT * FROM whatever WHERE thing='" & theVar & "'"
etc...
%>

The user can then just click on the item in the HEAD and click on the Edit button and type their reference code in...?
posted by derbs at 4:24 PM on March 3, 2009


Response by poster:
maybe you could put at snippet of ASP code in an editable region in the HEAD of the template...

<>

and then modify the SQL so it would read

<> sql="SELECT * FROM whatever WHERE thing='" & theVar & "'"
etc...
%>

The user can then just click on the item in the HEAD and click on the Edit button and type their reference code in...?


This is what it I have and how this is set up. That is no problem.

What I want is to set up a .dwt in Dreamweaver such that theVar is an editable region so end users using either Dreamweaver or Contribute can modify theVar's value.

That is the rub.
posted by xetere at 5:57 AM on March 4, 2009


if thevar is in an editable section the user will be able to edit thevar value

in the .dwt it would look like:

<!-- TemplateBeginEditable name="head" -->
<%myVar="abc123"%>
<meta stuff etc-->
<!-- TemplateEndEditable -->
posted by derbs at 8:15 AM on March 5, 2009


Response by poster: but derbs then they can edit the entire head. They'd be able to change the .asp code which is what I am trying to avoid. Ideally something like...

<><> myVarValue%> put in the value here<><>

or something similar. I am not sure that something like that "can" be done using .asp classic and Dreamweaver templates. Adobe sells something called Dreamweaver Developer Toolbox which for some reason I cannot download. THe documentation is vague enough so that I don't know if it will do this, but it does promise making dynamic Web sites easier.
posted by xetere at 7:06 AM on March 7, 2009


Response by poster: Sorry didn't use HTML codes for Greater Than and Less Than - should have previewed, so here it is again...



<%myVar="%>
<!-- TemplateBeginEditable name="myVar" --%>put in value here<!-- TemplateEndEditable --><%"%>
posted by xetere at 7:12 AM on March 7, 2009


« Older What does back off mean?   |   Help me transition from journalism to government... Newer »
This thread is closed to new comments.