-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use this plugin to override the frontend com_content category view, blog layout #1
Comments
On quick look (at work right now), the following is not an array or object, so you should be able to just echo the contents. Meaning, change this: To this: |
Well, neither ver_dump, neither echo is executed. My question is most about onafterInitalise callback. Is it the right to use even in front end? Forgive my poor english... |
Looked at the code, again. The line that you need to change is Change "administrator" to "site" to use this approach on the frontend. |
Thanks that's it. Now i've got a 500 error because display is not found. Do you have an idea? |
Yea, don't be changing the folder structure. That would be no fun, at all. =) Not sure where "display" is coming in -- can you explain what you are trying to do? That will help me better advise you. |
Ok, So, i installed your plugin and i changed code like that:
And the folder structure: And i've got this error while calling this page: In ContentViewCategory2.php file:
|
Wait. Sorry. Let me rethink this. |
Ok, so if i name my class as the class which iam overriding, there is no extends then! And my JLoader seems to call the file whithin the plugin folder But you're right, if i set |
Yea, I answered too quickly - removed my comment but not before you read it, apparently. Put those class names back to 2 the way you had them. You are right -- this is probably your problem: Maybe try this: |
Thanks Amy, but i think that the folder "category" whithin plugin views folder isn't read at all. Neither its ContentViewCategory.php file. In the layout.php file:
I'm a bit lost now. Could you explain what JLoader: :register stands for? Thanks for your help. I noticed that you build a fork of Joomla which seems interresting, when i'll have time, i'll test it. |
It's me again. Then, the view.html.php is really called. But if in this view.html.php i use (as you do in ContentViewArticle2.php): To conclude, i think that JLoader::register loads and executes the class, then it's impossible to overide by this way. |
Hi Amy and Liliwol, by using Amy's plugin I've succeeded to override the com_content archive front end view. Basically what I wanted to achieve was a blog-like monthly archive for articles from a specific category (combined with a module to display months). This was not possible with the stock com_content as the archive model selects only archived articles (state=2). I've overridden the view and model and changed the ContentModelArchive model to select published articles (state=1) and within a given category (category_id=x). It is a really small modification to Amy's plugin but I thought you would like to take a look, especially Liliwol, who had issue with modifying the plugin. I will shortly fork the project and apply my changes. Cheers |
Please leave a link to your fork so that folks know where to look. I'm not actively developing in Joomla at this time. Thanks much! |
Here is my fork https://github.com/ienev/Layout-Override-Plugin Thanks |
Hi,
and thanks for that plugin, i tried to write my own to override view.html.php, and i didn't succeed.
So i installed yours, but it is limited to administration side.
Could you tell how to use it for frontend side and to another view (category) ?
I changed layout.php as:
function onAfterInitialise(){
var_dump(JFactory::getApplication()->input->get('option', '', 'cmd'));
}
}
But the var_dump never displays anything...
The text was updated successfully, but these errors were encountered: