FORUMS CLOSED DUE TO SPAM. YOU STILL CAN ADD POST!

New Plugin: External Page Part Access

Feed 3 posts, 2 voices

Avatar
11 posts

Hej guys,

I’ve just written a small plugin called Page Part Access.
It provides a way to access a single page part externally i.e. for loading content to a page dynamically via ajax.
When installed, each page part can be accessed via http://example.com/thepage/-part

I think it’s quite useful, so I want to share it with you.
You can find the master branch of the plugin here and version 1.0.0 here (!!ATTENTION!! since the update there are new links – see below).

It would be nice to have a few opinions and recommendations so that I have the possibility to improve this.

BTW: If you look at the source, you’ll see I’m currently preventing the standard output by calling die(). Is there a better/nicer way to do that?

Cheers – Samuel

Update:

Added support for several metadata entries (title, breadcrumb, author, slug, description, tags) and renamed the plugin into Page Dash Access (think of the dash-character).
Metadata example: http://example.com/page/-meta-title

Please pay attention to the new links for the master branch and version 1.0.2.

 
Avatar
125 posts

Great!
Is it possible to apply a spécific template?

 
Avatar
11 posts

Interesting thought.
Could you outline an useful example for that?

A simple solution I think of is creating another page part as a template.
For example: You got two parts now: body and format_body
In body you have your common content, and in the format_body you build some code around it and access the body-part via $this->content('body').

Would that fit your needs?

PS: The most current stable version is always accessible here.

 
Avatar
125 posts

Thank’s…
Very interesting to ajaxify content or to use with a modalbox (or other lytebox).