Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-06-10 08:02:39

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

rsx_frontend_edit: Frontend Edit Link

I’ve made a plugin to allow for front end editing. From the help:

<blockquote>

This plugin will add a link to your posts that will take you directly the edit screen in your textpattern install. The link is hidden by a cookie that you can turn on or off. You will need to be logged in to textpattern to be able to actually edit the post, this plugin provides a shortcut from a post directly to the edit screen.

First upload the files <code>rsx_frontend_on.php</code> and <code>rsx_frontend_off.php</code> to your website, and place them in a location you can reach. The <code>textpattern</code> directory is a good spot. You will need to run the rsx_frontend_on.php file to toggle the visibilty of the frontend edit link on. You can run the file rsx_frontend_off.php to turn the visibility off.

Simply place the tag <code><txp:rsx_frontend_edit_link> link text </txp:rsx_frontend_edit_link></code> anywhere on a form you use to display a post. This will create a link to the edit screen for that post.

</blockquote>

If you want to use the plugin, grab this file: rsx_frontend_edit.txt. You will also need two php files to set and unset a cookie: rsx_frontend_on.php.txt, and rsx_frontend_off.php.txt. These last two files you will need to rename back to proper php files.

You can read more about this subject at brain-dump, though from a Moveable Type perspective.

You can read my post on the subject, which basically contains the same information that has been posted here.

Update August 30th 2005: The plugin has been fixed so it works with Textpattern 4.0. The change is small, the variable formally known as $pfr is now known as $hu. If there are any problems let me know. This version will not work with older versions of Textpattern.

Update Sept 10th 2005: The ampersands in the link are now escaped — that is they are generated as &amp; instead of simply &. This is not important unless you don’t like having the invalid characters on your web page. (Plugin version should be 1.2.3)

Update Dec 1st 2005: The plugin now uses the constant hu, which I had thought was a variable earlier. There is a new tag, <txp:rsx_frontend_new_article_link> which generates a link to an empty new entry page.

Update October 29th 2006: The plugin now uses <txp:php> tags instead of raw php open and close tags. The raw tags have been deprecated.

Last edited by ramanan (2006-10-29 14:47:37)

Offline

#2 2004-06-10 14:38:34

nryberg
Member
From: Minneapolis, MN - US
Registered: 2004-02-24
Posts: 20
Website

Re: rsx_frontend_edit: Frontend Edit Link

This is excellent – it’s something I’ve been wanting for a while, and I’m really happy to see that you’ve implemented it.

I’ll give it a try and let you know how it works.

Offline

#3 2004-06-10 19:39:17

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_frontend_edit: Frontend Edit Link

Great. As far as I can tell it works, though I appreciate the feedback. Let me know if it doesn’t work.

Offline

#4 2004-06-11 00:15:25

Macubu
Member
From: Milano, Italia
Registered: 2004-04-13
Posts: 58
Website

Re: rsx_frontend_edit: Frontend Edit Link

Seems very interesting, but I can’t get it to work. Txp doesn’t process it, and I can see the tags in the source of the webpage. What is it that I do wrong? I think because of me using the Rewrite Rule in order to get clean links to work?
Thanks for any info…

Offline

#5 2004-06-11 00:26:20

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_frontend_edit: Frontend Edit Link

Well the tag will disappear if you don’t have the cookies set properly. It generates some php code, and so that won’t show up at all in the resultant page. Did you set the cookie properly using the rsx_frontend.php file. The cookie will also only work for a particular URL it is associated with. So if you set it for www.funkaoshi.com it won’t display if you view funkaoshi.com for example.

Offline

#6 2004-07-22 19:48:19

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_frontend_edit: Frontend Edit Link

Updated the plugin. It now actually displays the text you place between the tags. Also, there are suffix and prefix attributes if you want to place text before or after the link.

Offline

#7 2004-07-27 19:08:40

starzabove
Member
Registered: 2004-04-13
Posts: 76

Re: rsx_frontend_edit: Frontend Edit Link

I’m not sure what I might be doing wrong but I am getting this across the top of the page:
<code>

Warning: Missing argument 2 for rsx_frontend_edit_link() in /home/username/public_html/textpattern/publish.php(764) : eval()’d code on line 80

</code>

What I did was to put:
<code>
<txp:rsx_frontend_edit_link > link text </txp:rsx_frontend_edit_link >
</code>

Within the default article form. I even tried placing it in a few different places.
Any ideas would be appreciated, Thanks.


90+ Textpattern installs and still going…

Offline

#8 2004-07-27 23:31:52

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_frontend_edit: Frontend Edit Link

Not sure. Do you have the latest version of the plugin. Should be 1.1. I am using the tags myself, and basically am doing what you are doing.

Offline

#9 2004-07-28 01:44:10

starzabove
Member
Registered: 2004-04-13
Posts: 76

Re: rsx_frontend_edit: Frontend Edit Link

Yes, I just downloaded it and installed it today.

Where exactly are you putting it?
Could it be conflicting with another plugin maybe?

Lost,
Thanks.


90+ Textpattern installs and still going…

Offline

#10 2004-07-28 02:35:25

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_frontend_edit: Frontend Edit Link

You should place the tag in an article form. I don’t see why it would conflict with anything else. It is complaining it isn’t finding the text between the tags. Try dropping the space you placed at the end of the tags, before the closing angle bracket, maybe textpattern is just parsing things funny?

Offline

#11 2004-07-28 08:52:21

starzabove
Member
Registered: 2004-04-13
Posts: 76

Re: rsx_frontend_edit: Frontend Edit Link

Aha!
Dropping the spaces at the end of the tags, right before the ending > bracket worked.

Thanks so much!


90+ Textpattern installs and still going…

Offline

#12 2004-07-28 13:17:37

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_frontend_edit: Frontend Edit Link

Cool. So it was just a parsing issue with textpattern.

Offline

Board footer

Powered by FluxBB