Search

Hi,

I’m a new user of symphony.

How i can create a macro parameter like this (‘m’) for display mobile devices site:

http://mysite.com/about/ http://mysite.com/m/about/

Sorry for bad english,

Regards,

Marco

One way to do it would be to create a distinct page tree within your site. So, for instance:

- /
- /about
  - /about/bio
- /articles
  - /articles/archive
- /m
  - /m/about
    - /m/about/bio
  - /m/articles
    - /m/articles/archive

You can reuse the same Data Sources and Events on each pair of normal/mobile pages, but import different master templates. And if much of the markup will be the same, you can use Utilities to abstract it and share it between both sets of pages.

Nice method. I didn’t think about it. Thanks very much!

I will try.

Thank you again,

Marco

I thought about it but in this way if i want to add another possible “macro parameter”, I have to recreate all pages. I need a sort of parameter.

The specific problem, as i think you have understood, is create a mobile site, with same data source, same page template but only different master.xsl.

And i would like to have a url like this: /m/about/

Any help?

Prove me that symphony is extensible :) (I’m joking)

You could add a set of rules like

### MOBILE RULES
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(m)/(.*/?)$ index.php?mobile=true&symphony-page=$2&%{QUERY_STRING} [L]

right before the frontend rewrite rules in your .htacces file. This way you set the $url-mobile parameter to true when you visit URLs like /m/page/other/params/.

I like your style! Would never have thought of this myself!

thank you very much, so simple, so powerful! i will do it in this way

Thank you very much Jonas! This is just what i need! :D

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details