Custom field display

  • Posts: 28
  • Thank you received: 0
13 years 7 months ago #13866

Is it possible to get a detailed product specification including custom fields to appear in a different module while the main product view is displayed?
I assume that just creating a 2nd hikashop content module will not do it unless it can be coded not to display on every page...

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

  • Posts: 82865
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #13869

There is no option for that.
It's possible to do it, if you have some PHP skills, by editing the file show of the view product and storing the HTML of the specifications somewhere without displaying them and then creating a module which would just display the HTML. Then, with Advanced Module Manager, you can set that module to only display if there is something in it.

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

  • Posts: 28
  • Thank you received: 0
13 years 7 months ago #13873

Even if I could do that, I am running Joomla 1.6 and AMM does not work with that :-(

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

  • Posts: 82865
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #13877

Without AMM, you can still do that but you have to edit your template to not display the load position of the module when not on a product page.

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

  • Posts: 28
  • Thank you received: 0
13 years 7 months ago #13878

I am using the Mercado theme from RocketTheme which (to me) seems hideously complicated and is built on top of their Gantry framework

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

  • Posts: 82865
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #13880

I didn't look at the mercado files so I can't say.

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

  • Posts: 28
  • Thank you received: 0
13 years 7 months ago #13887

Is it possible to achieve the above purely by editing the show.php and without having to touch the template?

i.e. display the view of the product without the spec and then make a call to show a separate content module in a different position?

Sorry if this is a silly question - a lot of this is still new to me.

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

  • Posts: 82865
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #13888

Yes. That's what I wrote earlier:

It's possible to do it, if you have some PHP skills, by editing the file show of the view product and storing the HTML of the specifications somewhere without displaying them and then creating a module which would just display the HTML.

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

  • Posts: 28
  • Thank you received: 0
13 years 7 months ago #13907

I have found a module that allows custom php inserts here extensions.joomla.org/extensions/edition...code-in-modules/3668
with a simple copy of the relevant parts of show.php that should only leave the question of how to hide empty modules in 1.6 with the incomprehensible RT template...

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

  • Posts: 82865
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #13909

You can't just copy parts of the show file in the module.
The show file needs the data from the view.html.php file in order to display it. In your module, you won't have that data available.
The easiest is to put around the tags below around the code you want in your module:
<?php ob_start(); ?>

and

<?php $_REQUEST = ob_get_clean(); ?>


Then, in your module you can just have the code: <?php echo $_REQUEST; ?>

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

  • Posts: 28
  • Thank you received: 0
13 years 7 months ago #13911

thanks -will try that

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

  • Posts: 28
  • Thank you received: 0
13 years 7 months ago #13940

When I put in the php using the custom view, I notice that it creates the override show.php in httpdocs/templates/beez5/html/com_hikashop/product even though I'm not using the beez5 template...this would seem to be a bug...

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

  • Posts: 82865
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #13953

You have one show file per template on your website. If you edit the show file for the beez template, the modification will go in the bee template, if you edit the show file of your main template, it will put it in the main template.
That allows you to have different modifications for different templates on your website (you can use several templates on a joomla website).

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

  • Posts: 28
  • Thank you received: 0
13 years 7 months ago #13959

Silly me. I was editing the wrong show.php
Your PHP above worked a treat combined with blank_mod.
Now just need to work out how to only display the module when the product page is shown...

Thanks so much for the great support.

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

Time to create page: 0.076 seconds
Powered by Kunena Forum