diiferent view to different link

More
10 years 2 months ago #2271 by gsmiphone
www.koopjeaanbieding.nl/

i made these view to thumbnail, now the below two links are the same page , could we make the these two pages to different view like listing view?

www.koopjeaanbieding.nl/dagaanbieding
www.koopjeaanbieding.nl/index.php/Dagaanbieding

Please Log in or Create an account to join the conversation.

More
10 years 2 months ago #2274 by bram
you could check the request-uri and select a different layout

or you could fiddle with the tmpl parameter

devakantieportal.nl/bekijk/oostenrijk/silvretta+arena+ischgl+samnaun/ischgl/app.+tyola?tmpl=map

devakantieportal.nl/bekijk/oostenrijk/silvretta+arena+ischgl+samnaun/ischgl/app.+tyola


support/time for this is beyond scope of the pro-license

Please Log in or Create an account to join the conversation.

More
10 years 2 months ago #2276 by robidos
@bram

where can tmpl=map be found as path?

Please Log in or Create an account to join the conversation.

More
10 years 2 months ago #2281 by bram
What 'as path'?


in your templates/USED-TEMPLATE/ directory you can create file used by the tmpl parameter.

Copy index.php ( or component.php ) to a different file, for example list.php

now you can use example.com?tmpl/list


In general joomla has a quite complex system of templates, layouts, override and chromes. For details go here : docs.joomla.org/Understanding_Output_Overrides .

There are examples in their how you can switch your layout in the view ( called templates to make it confusing)
The following user(s) said Thank You: robidos

Please Log in or Create an account to join the conversation.

More
10 years 2 months ago - 10 years 2 months ago #2283 by robidos
now i understand a bit more, but creating a whole new page template is a bit over the top, all you need is a parameter for the layout setting tmpl. so thats where it got me confused.


looking at the sourcecode (jform[params][template]) i see you are using the global joomla core variable "template" as a template parameter (template1 and template)? can this be done ?

because this same param is also the way joomla changes between templates. so because you are using it in datafeeds, it will give errors when its called via an url like this;

devakantieportal.nl/2-middellandse+zee/i...ameer?template=dummy

versus this:

devakantieportal.nl/2-middellandse+zee/i...meer?template=atomic

am i correct?, that you need will to change that param into a less conflicting name?

it cant fetch the datafeeds template dummy view because it is looking for the joomla template called dummy, not the default_dummy.php file so it is loading a full backup, but without the joomla template. (ehm why?)

another way to make grid/list/thumb requests is by coding param options in the template index itself. but iam still trying to make that one work.

like (they do with the templatecolor options in beez)

$grid = $this->params->template('dummy');
$list = $this->params->template('list');

i have also tried the joomla approach they offer for components view and layout by copying and naming the map items (naming it grid)inside /components/com_datafeeds/views, but i get a 500 error on the site level when do

[strike]?option=com_datafeeds&view=grid[/strike] not working

so it has to be something like

?option=com_datafeeds&view=items&layout=dummy|full|grid|list|etc.. (not tested)



back 2 the testlab :)
Last edit: 10 years 2 months ago by robidos.

Please Log in or Create an account to join the conversation.

More
10 years 2 months ago #2284 by bram
The whole layout/template mechanism is quite long nd I'm not sure I got all of it. But well

On site level you have the template

/templates/template/

You can have several templates active on a site, templates are then assigned to menu's

Within a template you can have several tmpl's

/templates/template/index.php

/templates/template/component.php

/templates/template/yours.php

They are invoked using tmpl=yours

on a component level you have several views, the view is part of the MVC design joomla uses. The datafeeds component has just one view. The content component has several, each has a distinct 'taks' like showing a single article or a blog.

Within the view you can have several tmpl's again. The component as just one 'default'. Each tmpl can have several sub-tmpl. These are the ones you can select in the menu-configuration.

Each tmpl can be overriden on a per template base using the joomla template override.


If you want to select a different template using a url parameter you must be sure that you don't use those reserveed by joomla.

To use a ?v=tmpl you could modify the default.php:
Code:
$template=JRequest::getVar('v',$this->where['template']);

however it will require some more work to get it persistent
The following user(s) said Thank You: robidos

Please Log in or Create an account to join the conversation.

Time to create page: 0.262 seconds