This repository has been archived by the owner. It is now read-only.

[IMP] Plugin get overridable layout #1408

Merged
merged 6 commits into from Sep 23, 2012

Conversation

Projects
None yet
6 participants
@phproberto
Contributor

phproberto commented Jul 24, 2012

Helper function to ease the plugin layout overrides based on the JModuleHelper getLayoutPath function.

For example the plugin Content - Pagenavigation will search his overrides in:

template/YOUR_TEMPLATE/html/plg_content_pagenavigation

And the default layout would be:

plugins/content/pagenavigation/tmpl

@mbabker

This comment has been minimized.

Show comment
Hide comment
@mbabker

mbabker Jul 24, 2012

Member

I'd be supportive of something like this. I currently use some internal code in a plugin that allows users to override the output, and I know of a few other plugins doing similar workarounds.

Member

mbabker commented Jul 24, 2012

I'd be supportive of something like this. I currently use some internal code in a plugin that allows users to override the output, and I know of a few other plugins doing similar workarounds.

@piotr-cz

This comment has been minimized.

Show comment
Hide comment
@piotr-cz

piotr-cz Jul 27, 2012

Contributor

I guess plugins were meant to not output any HTML, so there was not override functionality built in (this has been discussed few times already), but there are exceptional cases.
Most JoomlaWorks plugins have this functionality built in since Joomla 1.5 and it's great.

I'm for this to be in core.

@phproberto: Consider replacing DIRECTORY_SEPARATOR with /. I think this is the convention in the platform as PHP deals perfectly fine with both types of slashes in paths and this makes code more readable.

Contributor

piotr-cz commented Jul 27, 2012

I guess plugins were meant to not output any HTML, so there was not override functionality built in (this has been discussed few times already), but there are exceptional cases.
Most JoomlaWorks plugins have this functionality built in since Joomla 1.5 and it's great.

I'm for this to be in core.

@phproberto: Consider replacing DIRECTORY_SEPARATOR with /. I think this is the convention in the platform as PHP deals perfectly fine with both types of slashes in paths and this makes code more readable.

@phproberto

This comment has been minimized.

Show comment
Hide comment
@phproberto

phproberto Jul 27, 2012

Contributor

You are true @piotr-cz

I forgot to remove the DIRECTORY_SEPARATOR's. I'll modify it ASAP.

Thanks for the advice and support !

Contributor

phproberto commented Jul 27, 2012

You are true @piotr-cz

I forgot to remove the DIRECTORY_SEPARATOR's. I'll modify it ASAP.

Thanks for the advice and support !

@phproberto

This comment has been minimized.

Show comment
Hide comment
@phproberto

phproberto Jul 31, 2012

Contributor

I've fixed the DIRECTORY_SEPARATOR with slashes.

Thank you all for your feedback.

Contributor

phproberto commented Jul 31, 2012

I've fixed the DIRECTORY_SEPARATOR with slashes.

Thank you all for your feedback.

@phproberto

This comment has been minimized.

Show comment
Hide comment
@phproberto

phproberto Aug 13, 2012

Contributor

Any news about this? Will be great to see it approved and submitted to joomla-cms to be in Joomla! 3.0

Contributor

phproberto commented Aug 13, 2012

Any news about this? Will be great to see it approved and submitted to joomla-cms to be in Joomla! 3.0

@AmyStephen

This comment has been minimized.

Show comment
Hide comment
@AmyStephen

AmyStephen Aug 15, 2012

Contributor

This makes good sense, to me. It's just one more step towards getting rendering more flexible. Probably dozens of ways to do this but this looks suitable to me, inline with how other output rendering is handled. Even if a new approach is used with the new Integrated Content system, having this for 3.N series would be good.

Thanks Roberto!

Contributor

AmyStephen commented Aug 15, 2012

This makes good sense, to me. It's just one more step towards getting rendering more flexible. Probably dozens of ways to do this but this looks suitable to me, inline with how other output rendering is handled. Even if a new approach is used with the new Integrated Content system, having this for 3.N series would be good.

Thanks Roberto!

@piotr-cz

This comment has been minimized.

Show comment
Hide comment
@piotr-cz

piotr-cz Aug 16, 2012

Contributor

Just hope it's not too late to include it in the 3.0 trunk. Probably most forces are on Bootstrap integration.

Contributor

piotr-cz commented Aug 16, 2012

Just hope it's not too late to include it in the 3.0 trunk. Probably most forces are on Bootstrap integration.

+ * @param string $name Plugin name
+ * @param string $layout Layout name
+ *
+ * @return string Layout path

This comment has been minimized.

@pasamio

pasamio Aug 18, 2012

Contributor

Can you add a @since 12.2

@pasamio

pasamio Aug 18, 2012

Contributor

Can you add a @since 12.2

This comment has been minimized.

@phproberto

phproberto Aug 20, 2012

Contributor

Done ;)

@phproberto

phproberto Aug 20, 2012

Contributor

Done ;)

@LouisLandry

This comment has been minimized.

Show comment
Hide comment
@LouisLandry

LouisLandry Aug 18, 2012

Contributor

Why wouldn't you just use JViewHtml to support this functionality? You have layouts and overrides just built into that. It's very lightweight as well. It then keeps the clear separation of presentation responsibilities independent of the event handling system.

Contributor

LouisLandry commented Aug 18, 2012

Why wouldn't you just use JViewHtml to support this functionality? You have layouts and overrides just built into that. It's very lightweight as well. It then keeps the clear separation of presentation responsibilities independent of the event handling system.

@phproberto

This comment has been minimized.

Show comment
Hide comment
@phproberto

phproberto Aug 20, 2012

Contributor

@LouisLandry This is based on the same method already existent for module layouts. I've been watching the JViewHtml class and you are right, it's better prepared for layouts but that will probably be harder than create a simple method.

Contributor

phproberto commented Aug 20, 2012

@LouisLandry This is based on the same method already existent for module layouts. I've been watching the JViewHtml class and you are right, it's better prepared for layouts but that will probably be harder than create a simple method.

@AmyStephen

This comment has been minimized.

Show comment
Hide comment
@AmyStephen

AmyStephen Aug 20, 2012

Contributor

Core code needs to be inline with architectural directions.

Contributor

AmyStephen commented Aug 20, 2012

Core code needs to be inline with architectural directions.

@phproberto

This comment has been minimized.

Show comment
Hide comment
@phproberto

phproberto Sep 16, 2012

Contributor

Any news about this? :(

Contributor

phproberto commented Sep 16, 2012

Any news about this? :(

pasamio added a commit that referenced this pull request Sep 23, 2012

Merge pull request #1408 from phproberto/plgtpl
[IMP] Plugin get overridable layout

@pasamio pasamio merged commit 49f4a29 into joomla:staging Sep 23, 2012

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.