Select displayed templated in url (&template=XXX)

  • Nils Reinecke
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 4 months ago #48651 by Nils Reinecke
Hi,
It would be very helpfull to select the displayed template via url to work on the template while the shop is online.

For example:
  1. copy my template
  2. so i have to folders 1. /template/ 2. /template-copy/
  3. now i start working on /template-copy/
  4. when i finished i open my shop with somthing like "shop.com/index.php?option=com_eshop&template=template-copy" and i get my shop displayed with the new template instead of /template/
  5. the shop is still online for everybody with the old template (/template/)

Is this possible? Or would it be easy to integrate?

Greetings from Germany
Nils

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

  • Giang Dinh Truong
  • Offline
  • Administrator
  • Administrator
More
10 years 4 months ago #48694 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Select displayed templated in url (&template=XXX)
Hi Nils,
EShop support multiple templates/themes, please read the documentation at eshopdocs.joomservices.com/extensions/themes.html
At the one time, there will be one theme is chosen as default.
Hope that this will help.
Sincerely, Giang
The following user(s) said Thank You: Nils Reinecke

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

  • Nils Reinecke
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 4 months ago #48720 by Nils Reinecke
Replied by Nils Reinecke on topic Select displayed templated in url (&template=XXX)
I know but is it possible to load the same shop in two different templates at the same time?
So see theme1 and other users see theme2?

Best regards
Nils

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

  • Giang Dinh Truong
  • Offline
  • Administrator
  • Administrator
More
10 years 4 months ago #48748 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Select displayed templated in url (&template=XXX)
Hi Nils,
I know the thing that you want to have but this is not supported by EShop now. It is an outstanding feature and there are not much people need it.
Sincerely, Giang

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

  • Nils Reinecke
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 3 months ago #49217 by Nils Reinecke
Replied by Nils Reinecke on topic Select displayed templated in url (&template=XXX)
Could you build me anything "dirty" just to view two different templates? i really need to build a new template with you new functions and stuff..

thanks

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

  • Nils Reinecke
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 3 months ago #49221 by Nils Reinecke
Replied by Nils Reinecke on topic Select displayed templated in url (&template=XXX)
So Giang,
got it on my own. Its dirty but i did it. ;) Maybe you could implement somthing like that into your next release.

Just put the following into: com_eshop\helpers\helper.php
Code:
if( $configKey == 'theme' ) { return (isset( $_GET['eshop_theme'] ) && !empty( $_GET['eshop_theme'] ) ) ? $_GET['eshop_theme'] : ( $configValues[$configKey] ? $configValues[$configKey] : $default ); }

The result should look like this
Code:
public static function getConfigValue($configKey, $default = null) { static $configValues; if (!isset($configValues["$configKey"])) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('config_value') ->from('#__eshop_configs') ->where('config_key = "' . $configKey . '"'); $db->setQuery($query); $configValues[$configKey] = $db->loadResult(); } if( $configKey == 'theme' ) { return (isset( $_GET['eshop_theme'] ) && !empty( $_GET['eshop_theme'] ) ) ? $_GET['eshop_theme'] : ( $configValues[$configKey] ? $configValues[$configKey] : $default ); } return $configValues[$configKey] ? $configValues[$configKey] : $default; }

Just add the paramenter "eshop_theme" to your url and fill it with the theme name.
Now you got the eshop displayed with the requested theme.

Hope this is a little insperation for your next release.
Looking forward to it ;)

best regards
Nils
The following user(s) said Thank You: Giang Dinh Truong

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

  • Giang Dinh Truong
  • Offline
  • Administrator
  • Administrator
More
10 years 3 months ago #49292 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Select displayed templated in url (&template=XXX)
Hi Nils,
Congratulation on that. I will considering to add this feature into EShop if it is useful and there are many people want it.
Sincerely, Giang

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

Moderators: Giang Dinh Truong