How to use custom viewtype


4 hours ago
Please help me.
I have a theme, which is located in the mod / ddevel_index.
The folder structure is a
views /
        default
        default-1280 - the width of the template 1280
        default-1600 - the width of the template 1600
        default-1920 - the width of the template 1920
What I need to add in start.php, so I can switch from default to any other (default-1280, default-1600, etc).
For example http://localhost/elgg/?view=default-1280.

  • What are those themes? Just css or do you have different views in there as well?

  • looks like you want to detect client screen size attribute and direct to appropriate views for the size...

     

  • >looks like you want to detect client screen size attribute and direct to appropriate views for the size...

    Yes, that's what I need. 

  • Hmmm It takes you a long time to come back and comment ;-) as if the issue is not too important for you lolz ;-P I myself have looked at similar client detection for several different purposes before including mobile devices. I reckon that the techniques you will need would be similar to what's used for client detect and views control for mobile devices -- can be done using either JS - wrapped inside Elgg PlugIn structures or wrapped with jQuery or some other ways to achieve this functionality.. Just needs some level of code-smarts to figure the algorthms/ tricks. Cheers ;-O

  • The thing is that I tried to use return elgg_set_viewtype ();
    But I was so well understood that the function elgg_set_viewtype (); applies only to
    elgg / views / location, and not to the mod/mytheme/views/. I just wanted to know if I could change the way the standard methods of mod/mytheme/views/default on mod/mytheme/views/default-1280

  • You cant do the redirect based on browser resolution through php. php is for server side validation, where as detecting user browser details is a client side validation. You need to use javascript or jQuery to do a redirect.

  • @TW: I disagree ! ;-) Thats' how Mark Harding did his ElggMobile lolz;-o Both PHP and JS can detect the client.. php:= header(Location: http://example.com/view=...'); Which to use ? --> depends on yr 'coding mood..'

    @Alex: Looks like you're wading into deeper waters..

     

  • I understand. What a mistake. need to use default1280 - without "-"