Page 1 of 1

Static page and dynamic url call

Posted: Thu Sep 01, 2005 3:13 pm
by Frandy
Hi,

Is it possible to use staticpage plugin with dynamic url arguments ?

Standard url for static page call is for example :
http://www.mysite.com/blog/index.php?/w ... e_url.html

declared staticpage_url in serendipity staticpageplugin = http://www.anothersite.com (for example)


i 'd like to use something like that :
http://www.mysite.com/blog/index.php?/w ... &cat=data2

realurl = http://www.anothersite.com/index.php?id=data1&cat=data2

where data1 and data2 arguments are dynamics--> means i can create links in an entry to dynamic url using only one staticpage plugin in serendipity admin.

is it clear and esay to do ?


Thanks,

Frandy

Re: Static page and dynamic url call

Posted: Thu Sep 01, 2005 3:59 pm
by garvinhicking
What you want to do sounds more like you want to do string replacements of URLs. This seems to be completely unrelated to staticpages, as the target page is not hosted in your staticpage.

Thus I recommend to use the "Content Rewrite" plugin, or to add your own BBCode rule in the markup plugin.

1. Insert "Content rewrite" plugin.

2. Configure it:
Plugin-Title: MyLinks Open
Rewrite String: <a href="{to}
Rewrite Char:
New Title: (mylink)
New Description: http://www.othersite.com/index.php?
Check "EntryBody/Extended Body" fields to "Yes"

3. Click on Save

4. Insert a second "Content rewrite" plugin

5. Configure it:
Plugin-Title: MyLinks Close
Rewrite String: ">{to}</a>
Rewrite Char:
New Title: (/mylink)
New Description: MyLink!
Check "EntryBody/Extended Body" fields to "Yes"

6. Click on Save.

7. Create a new entry. Insert:
(mylink) &name1=name1&name2=name2 (/mylink)

If you know some PHP, it's easier to modify the BBCode plugin to add your own "shortcut transformation".

Regards,
Garvin

Posted: Thu Sep 01, 2005 6:25 pm
by Frandy
Sorry Garvin

I made an error,

in fact i want to display a page (url and its dynamic arguments) in a iframe inside le blog like the wrapurl plugin does.

but i don't want to set a wrapurl plugin for all my links (nice for 1 or 2 wrapurl but not a dozen.

example:
wrapurl permalink is :
/blog/index.php?/wpages/external_portail.html
the url is
http://www.external_portail.com/index.php

but i want to display in the iframe this page:
http://www.external_portail.com/index.php?&data1=&data2=


wrapurlpermalink should be:
http://www.external_portail.com/index.php?&data1=&data2=

but i'd prefer to call wrapurl permalink using portail arguments.
should be
/blog/index.php?/wpages/external_portail.html&data1=&data2=

looks strange but should be nice


How is it possible to do that ?

Thanks a lot

Frandy

Posted: Thu Sep 01, 2005 8:54 pm
by garvinhicking
Uh, that should work the same way. :) Instead of making the content rewrite plugin emit a "<a href", just let it emit a "<iframe src=" instead.

I don't know what "portail" arguments are, though...

Regards,
Garvin

Posted: Fri Sep 02, 2005 12:18 am
by Frandy
It doesn't work :cry:

How is it possible to modify wrapurl plugin in order to accept dynamic arguments ?

example:
i use wrapurl permalink declared in plugin config in order to display a page as an entry.
http://www.mysite.com/blog/index.php?/w ... l_url.html

external_url.html is linked to root real url as for example http://www.anothersite.com/index.php (=external_url.html is a static url isn't it ?)

but i need links on several entries to display external url as a frame in an entry (like wrapurl plugin does) but using same external url root with dynamic arguments :

http://www.anothersite.com/index.php?data1=1
http://www.anothersite.com/index.php?data1=2
http://www.anothersite.com/index.php?data1=3
up to 10 !
http://www.anothersite.com/index.php?data1=10

and i don't want to add 10 wrapurl plugin in my blog admin !

should be too easy for wrapurl plugin to allow arguments like this :
http://www.mysite.com/blog/index.php?/w ... l/&data=xx
or
http://www.mysite.com/blog/index.php?/w ... hp&data=xx

what is ypur best solution ?

Regards

Frandy

Posted: Fri Sep 02, 2005 12:37 pm
by garvinhicking
Hi Frandy!
Frandy wrote:It doesn't work :cry:
What doesn't work exactly?
How is it possible to modify wrapurl plugin in order to accept dynamic arguments ?
You know that when you use the wrapurl plugin you will have a new page with the iframe contents, right? And then the entry itself will not show the iframe, only a link to the page with the iframe.

If this is what you want I can give you a patch on how to modify the wrapURL plugin.

If this is not what you want, and you want the iframe to appear inside the entry, forget about your WrapURL idea and focus on the content rewrite plugin. The WrapURL plugin acts like a static page, and is NOT a markup plugin, thus this is conceptually totally different than a markup plugin which does translate that. And the content rewrite plugin would do that, with the config I indicated.

Show me a test URL where you've created an entry like I've instructed with the plugins set up as I've instructed (show me a screenshot of your admin panel for the two plugins), then we can see what is "not working". :)

This all can be solved, but the way to go seems to me like the content rewrite plugin - wrapurl is totally opposite.

Regards,
Garvin

Posted: Fri Sep 02, 2005 1:03 pm
by Guest
garvinhicking wrote: You know that when you use the wrapurl plugin you will have a new page with the iframe contents, right? And then the entry itself will not show the iframe, only a link to the page with the iframe.
Yes you are right, but if user click on link on the entry then the external page appears like an entry inside the blog and that's what i want ! (but using arguments specified in link for the wrapurl root url call)
garvinhicking wrote: If this is what you want I can give you a patch on how to modify the wrapURL plugin.
So nice Garvin

Frandy


Thanks a lot

Posted: Fri Sep 02, 2005 1:29 pm
by garvinhicking
Please try this plugin: http://nopaste.php-q.net/157904

Set the URL you want to the basis URL of your target. Then just append the GET-parameters to the link to your wrapurl staticpage, and those parameters will be passed on to the iframe location. Also set the config option for "append GET-Variables" to "true" in the plugin config.

I hope this works - if not, please post the URL of your page where you tried it so I can have a look.

Regards,
Garvin

Posted: Fri Sep 02, 2005 1:57 pm
by Guest
garvinhicking wrote:Please try this plugin: http://nopaste.php-q.net/157904

Set the URL you want to the basis URL of your target. Then just append the GET-parameters to the link to your wrapurl staticpage, and those parameters will be passed on to the iframe location. Also set the config option for "append GET-Variables" to "true" in the plugin config.

I hope this works - if not, please post the URL of your page where you tried it so I can have a look.

Regards,
Garvin
You' re the best Garvin :wink: too bad !

except replace line 134 with :

Code: Select all

echo '<iframe src="' . $url .'" width="100%" height="100%" scrolling="auto" frameborder="0" style="height:100%;frameborder:0px" ></iframe>';
[/code]

Posted: Fri Sep 02, 2005 3:16 pm
by garvinhicking
Ah, thanks for finding this error, fixed it and will commit to CVS soon.

Best regards,
Garvin