Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-06-19 21:46:08

marco
Member
From: Montreal
Registered: 2004-02-24
Posts: 62

Plugin Request: custom path tag

Is there a tag, an option, or a plugin that would allow one to point to a particular folder under the TP installation, say ../site or ../js or ../image or ../css like this:

txp:path folder=“any-folder”

where “any-folder” is “site” or “site/img”, or “site/css” or “site/js” – you get the idea…

The tag would translate into:

http://localhost/textpattern/any-folder

This would be similar to the txp:css tag, except it would allow to point to any folder under the TP installation

Basically this would help avoid the path changes in the code when an html page is moved from the development site to the deployment site.

is there anything that allows me to do this now or would this be a new tag?

Is this a good idea at all?

Last edited by marco (2004-06-19 22:47:52)

Offline

#2 2004-06-22 21:05:49

abilstein
New Member
Registered: 2004-06-12
Posts: 5

Re: Plugin Request: custom path tag

I needed something similar (I’m working in a subdirectory right now that’s going to move), not sure if it’s what you were trying to do. I couldn’t find this tag already, so I made one:

<a href=“http://www.alexbilstein.com/files/path.zip”>Path Plugin</a>

Outputs the subdirectory path and appends a folder name if you want.

Offline

#3 2004-06-22 21:45:56

marco
Member
From: Montreal
Registered: 2004-02-24
Posts: 62

Re: Plugin Request: custom path tag

Great! How do you append the folder name, say “/img/travel” ?

Offline

#4 2004-06-23 14:05:49

abilstein
New Member
Registered: 2004-06-12
Posts: 5

Re: Plugin Request: custom path tag

Usage would be like this:

&lt;txp:arb_path folder=“img/travel”/&gt;

Let’s assume that your Subdirectory setting is “/~username/txp/”.

This function would then output:

“/~username/txp/img/travel”

Last edited by abilstein (2004-06-23 14:06:24)

Offline

#5 2004-06-23 14:30:56

marco
Member
From: Montreal
Registered: 2004-02-24
Posts: 62

Re: Plugin Request: custom path tag

Great!

Offline

#6 2004-06-23 14:55:27

marco
Member
From: Montreal
Registered: 2004-02-24
Posts: 62

Re: Plugin Request: custom path tag

I just tried to use it but the tag got a problem parsing double quotes;

I replaced:

<code>
<li><img src=“http://localhost/textpattern/site/img/square_blue.gif” /></li>
<li><a href=”#”>PROJECTS</a></li>
</code>

with:

<code>
<li><img src=”<txp:arb_path folder=“site/img/square_blue.gif” /></li>
<li><a href=”#”>PROJECTS</a></li>
</code>

this redenders as:

<code>
<li><img src=”/textpattern/site/img/square_blue.gif</li>
<li><a href=“tools.html>PROJECTS</a></li>
</code>

Notice the missing colsing quote for the img and href.

TP and the img folder are installed at:

<code>
c:/easyphp/www/textpattern/textpattern/ <—-the TP admin is here

c:/easyphp/www/textpattern/site/img/
</code>

Last edited by marco (2004-06-23 14:56:40)

Offline

#7 2004-06-23 15:09:13

abilstein
New Member
Registered: 2004-06-12
Posts: 5

Re: Plugin Request: custom path tag

Looks like you are missing the closing quote and bracket in your actual img tag. Try this:

<code>
<li><img src=”<txp:arb_path folder=“site/img/square_blue.gif” />”></li>
<li><a href=”#”>PROJECTS</a></li>
</code>

Offline

#8 2004-06-23 15:35:35

marco
Member
From: Montreal
Registered: 2004-02-24
Posts: 62

Re: Plugin Request: custom path tag

Indeed, that was it, thank you!!!

Offline

Board footer

Powered by FluxBB