XF 2.0 Accessing public templates from the admin section...

Jaxel

Well-known member
I feel like I'm doing something wrong here... opinions?

To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.
 
I don't really see it as a huge problem. It works and it's DRY. You can render public templates from the admin side of things by prefacing the template names with 'public:', but you'd have to duplicate your controller. If you're really concerned about separating them, you could probably split it into a controller plugin and just call that from both the admin and public controller.
 
Hmm... so I tried this:
Code:
<xf:macro template="admin:EWRporta_article_edit" name="edit_block" arg-article="{$article}" />


But I'm getting an error:
Template admin:EWRporta_article_edit: Template admin:EWRporta_article_edit is unknown (src/XF/Template/Templater.php:564)
The template definitely exists, as does the macro, since I am using it in my admin section.
 
Okay... it looks like you can access public templates from the admin section, but you cant access admin templates from the public section.
 
Back
Top Bottom