Zend Plugin found in view not in layout - php

I've got a plugin that retrieves a list of buttons.
When i call this plugin from the view (echo $this->GetAdminButtons()) it works fine.
But I need to call this plugin from the layout.phtml and when i do, the application just stops (white screen, no output)
When i try to get the exception message i get this error:
Plugin by name 'GetAdminButtons' was not found in the registry;
used paths:
Zend_View_Helper_Navigation_: Zend/View/Helper/Navigation/
Zend_View_Helper_: Zend/View/Helper/:./views/helpers/
In the application.ini
resources.view.helperPath.Admin_View_Helper = "Admin/View/Helper"
Which confuses me because it works fine in the view .phtml files
Thanks in advance,

Continuing the discussion from the comments. Try moving the resources.layout lines in your config so they are after the resources.view ones (my suggestion in the comment had things the wrong way round).
I think your issue is that the layout is being initialized before the view is, which is why the view paths don't exist in the layout.

Related

WP_Error on Tag and Archive Pages

I get the following error on Wordpress when i click on the archive or tag pages on my sidebar:
Notice: Undefined property: WP_Error::$slug in
/opt/wordpress/wp-includes/class-wp-error.php on line 78
I don't know where i can look after it, but i think it's somewhere in archive.php.
(We're using a custom theme, but i didn't code it). Maybe it also has something to do with the Plugin we use (its called: Ultimate Tag Cloud Widget)
Can someone help? (I can also post the whole archive.php file, if necessary)
Thanks!
Dear you just replace the old file(class-wp-error.php) in you error directory and then see what happend...
I got this issue recently and i just replace may file again from the previous back and its work out...
May be you also got the solution go to your error directory and paste the file...Thanks

joomla template on view=category

I make my own template , and its work well on www.90km2.com/index.php
But when I want to see com_content&view=category page on this link : http://www.90km2.com/index.php?option=com_content&view=category&id=23&Itemid=102
It doesn't work. Do you know why joomla didn't show my view?
I try another templates to see this page , all of them was worked well , but this view is not work with my own teplate :(
I would try copying the template which works then modify bit by bit to get your custom template then see when problem shows up. Or create a template which has the minimum stuff in there and see if it works. Just have jdoc:include type="component"/> in the body

Broken SilverStripe Template

For some reason, after doing a ?flush=all, a certain page type is not able to locate it's default template. I figure out that it's not loading it's template file after appending showtemplate=1 to the URL. The dumped raw template shows nothing for the default template.
Pastebin: http://pastebin.com/uMLefAsP
I wish someone could point me to the right direction here, for I have no idea where to start debugging.
Thanks, Jan.
Firstly, and I have to ask: Is there actually a PageType called "CommunityExtensionPage"? PageTypes need to be named the same as the required template, for the template to be picked-up automatically.
You seem to have two template files "CommunityExtensionPage.ss". One at "templates/CommunityExtensionPage.ss" and one at "templates/Layout/CommunityExtensionPage.ss"
It would be useful to see the contents of both files. SilverStripe will look for "CommunityExtensionPage.ss" in the top-level of the "templates" dir before looking in "templates/Layout".
If "templates/CommunityExtensionPage.ss" is found, it will also try and look for "templates/Layout/CommunityExtensionPage.ss" and render this into the $Layout template variable. Otherwise, it'll use the default "templates/Page.ss" and request "templates/Layout/CommunityExtensionPage.ss"
Does your "templates/CommunityExtensionPage.ss" template contain a reference to $Layout? If not, then the contents of "templates/Layout/CommunityExtensionPage.ss" will not be rendered.

How to make a template overwrite for mod_menu with alternative layouts for link outputs?

I understand and love template overwrites. I need to do some heavier changes to the menu output (basically making the output work better with Bootstrap) - but only for certain menus.
Currently in Joomla 3 there are the following in the mod_menu/tmpl folder:
default.php
default_component.php
default_heading.php
default_separator.php
default_url.php
If I want to change the classes I'd copy the default.php into my mytemplate/html/mod_menu and change it. Great, no problem.
If I want to change the link outputs to go along with that I can copy the default_component.php to mytemplate/html/mod_menu and change it. Great, no problem.
If I want to have the choice of having a different "Alternative Layout" I'd rename the mytemplate/html/mod_menu/default.php to newlayout.php, then select it in the admin module manager for that menu. Great, no problem.
Here's the problem: If I want to have the link output changed for certain menus but not all of them I figure I'd change default_component.php to newlayout_component.php like I did above which would correspond to the newlayout.php...but that doesn't work.
Questions:
1) How to have alternative layouts for each of the default_component.php, default_heading.php, default_separator.php, default_url.php template files (not just an overwrite)?
2) I would think default_url.php is the one that would affect the link outputs but it seems it's default_component.php that does. So what does each one of those do? I couldn't find any information on joomla.org about that.
Thanks!
The alternative layout feature only works for the main file (default.php), not for the sublayouts (default_component.php, ...). So you have to create your own newlayout.php which then can load newlayout_component.php, or use the default_component.php. In fact, the default_component.php will be used as fallback if no newlayout_component.php is found.
The code switches over the $item->type of the link. 'separator', 'url', 'component' and 'heading' are handled by the 'default_'.$item->type, everything else will use default_url. So a plain URL should indeed be generated by default_url.php, not default_component.php. If it behaves differently, it's likely a bug.

Can't find Joomla pagination template

I'm going crazy with this one. I am trying to change a little bit the pagination style and layout in Joomla. So, I found this file: libraries\joomla\html\pagination.php but I know that pagination is overridden by this file: templates\gk_yourshop\html\pagination.php. Yet, if I modify something in gk_yourshop\html\pagination.php, I can't see the change in the pages. Does joomla cache templates and I have to re-load them (like phpBB)?. I don't understand.
I tried to check if writePagesLinks is called from joomla\html\pagination.php with this:
function getPagesLinks()
{
echo "test";
global $mainframe;
and I can't see the message. I also did this in the other pagination.php file and it's just like I can delete them and it doesn't matter. Can you help me? Thanks!
Looks like I changed it here some time ago:
\libraries\joomla\html\pagination.php
But, that is system file, so i just make a "hotfix" of it.
In Joomla 3.x you can create pagination override from Extensions > Templates > Default Template > Create Overrides > Layouts > Pagination.
The override files are created in "Default Template" "html\layouts\joomla\pagination" folder.
You can edit the override files as per your needs.
Where are you getting WritePageLinks from? That's not one of the supported methods.
http://docs.joomla.org/Understanding_Output_Overrides#Pagination_Links_Overrides
There are four functions that can be used:
pagination_list_footer
This function is responsible for showing the select list for the
number of items to display per page.
pagination_list_render
This function is responsible for showing the list of page number links
as well at the Start, End, Previous and Next links.
pagination_item_active
This function displays the links to other page numbers other than the
"current" page.
pagination_item_inactive
This function displays the current page number, usually not
hyperlinked.
[edit]
You may also want to look at Protostar as an example.

Categories