getting a viewname starting by "view"

58 views
Skip to first unread message

Naouak

unread,
Feb 9, 2012, 10:13:56 AM2/9/12
to joomla-de...@googlegroups.com
Hi there,

It seems that when you create a component view that start with "view"(eg. "views"), Joomla will strip "view" from the title when searching for the templates.

e.g. : with a view called "viewsreport", Joomla is searching for files in :

templates/beez_20/html/com_vodreport/sreport/
components/com_vodreport/views/sreport/tmpl/

Is it a known bug/limitation ?

Naouak, Grade 2 de Kobal.
Site web: http://www.naouak.net

Jeremy Wilken

unread,
Feb 9, 2012, 10:32:18 AM2/9/12
to joomla-de...@googlegroups.com
This is not a bug, it is by design. They are not intended to be the exact same structure.

Only the files in the tmpl folder of a view available for overriding, and not the view.html.php or other such files.

Naouak

unread,
Feb 9, 2012, 10:39:03 AM2/9/12
to joomla-de...@googlegroups.com
no, the problem is not there.

The view try to get its name by looking at the class name.

Let's say for exemple the class name is :
MycmpViewViews

It can be understood to way :

the component is "MycmpView"
the view is "v"

OR

the component is "Mycmp"
the view is "Views"

Basically whenerver there is a "view" in your view name, the getName function of JView goes haywire and won't return what the current condition is.
Basically, JView should verify folder name to get view name and not classname which can be easily ambiguous.

I could get around that by setting the $name variable in my view but it's yet another declaration of the view name.

Naouak, Grade 2 de Kobal.
Site web: http://www.naouak.net


On Thu, Feb 9, 2012 at 16:32, Jeremy Wilken <gnom...@gnomeontherun.com> wrote:
This is not a bug, it is by design. They are not intended to be the exact same structure.

Only the files in the tmpl folder of a view available for overriding, and not the view.html.php or other such files.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/ceyzwCE0qeIJ.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.

Andrea Tarr at Tarr Consulting

unread,
Feb 9, 2012, 1:16:45 PM2/9/12
to joomla-de...@googlegroups.com
"View" is a reserved word in Joomla. This is for 1.5, but it's described here: 

Reply all
Reply to author
Forward
0 new messages