Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing the code on the fly

Status
Not open for further replies.

Jimuniguy

Technical User
Mar 6, 2002
363
GB
Hi,

At present, users contribute pages using Macromedia contribute, however, they can not edit the coding.

Problem:
At present all links end with the bog standard of
Code:
</a>]
. However, before the client sees the page I need the server to:

Change
Code:
</a>]
to be
Code:
<%=variablestring%></a>]
and then for it to solve the variable string bit

How is this possible please?

Thanks

Jim
 
Jim

[blue]Change </a>] to be <%=variablestring%></a>] and then for it to solve the variable string bit[/blue]

&quot;solve the variable string bit&quot;... what does that mean?

-pete
 
While Contribute users can't modify the existing programming, they can (without knowing it) add programming. In Contribute you can create custom buttons that insert chunks of code -- as long as the users are even slightly savvy you can create a custom button that inserts that bit of ASP for them. I'm not sure what they'll see (the only potential downside), but if the url itself doesn't change than the Contribute button can be made to insert the whole thing: opening <a...> tag, the ASP, and the closing </a> tag.

Another possibility would be to have the users effectively create a &quot;code&quot; designed to tell a processor page to make the change. For example the users could insert (optionally with a button) something like &quot;[VariableName]&quot; in their code. Once the saved/uploaded the page they could then go to a special ASP page on the site that:[ol][li]Provides a form for the user to specify the page name and location (URL)

[li]After submission the script opens that page using the FileSystemObject and replaces all instances of &quot;[VariableName]&quot; with &quot;<%=VariableName%>,

[li]Saves out the page, and

[li]Notifies the user that it has been updated.[/ol]Whether that would work for you or not depends a lot on your workflow and the server situation, but it's a possibility.
 
Hi,

1) Where in contribute can you make your own buttons???

2) where can I find a script which uses FileSystemObject to edit the page?

3) =variblestring is a string of variables which gets passed from page to page via the URL bit. It needs to be processed after the changing of the page to include it, but before it gets to the client

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top