You are here:  » Question config.php


Question config.php

Submitted by wesse249 on Mon, 2016-04-18 12:02 in

Hello David,

This is my config.php

{code saved}

On my productpage i have this line:

<p>Bekijk <a href='<?php print $config_baseHREF."merchant/".tapestry_hyphenate($product_main["merchant"]);?>/'>hier</a> het complete<?php print $config_subsubonderwerp ?> assortiment van <a href='<?php print $config_baseHREF."merchant/".tapestry_hyphenate($product_main["merchant"]);?>/'><?php print $product_main["merchant"]; ?></a></p>

I want to place a word behing my productname like this:

<h1><?php print $product_main["name"]; ?><?php print $config_onderwerp ?></h1>

Where onderwerp must be the category of the product. I want arrange it in the config.
But when i do it like this:

  $config_title = "example.com";
  $config_onderwerp = "$product_main["category"]";

it isn't working.

Thanks Jan Roel

Submitted by support on Mon, 2016-04-18 12:16

Hello Jan,

Rather than edit config.php at all, you can simply pick-up the category name from the $product_main variable e.g.

$product_main["category"]

So in your first block of code from product page, have a go with:

<p>Bekijk <a href='<?php print $config_baseHREF."merchant/".tapestry_hyphenate($product_main["merchant"]);?>/'>hier</a> het complete<?php print $product_main["category"]; ?> assortiment van <a href='<?php print $config_baseHREF."merchant/".tapestry_hyphenate($product_main["merchant"]);?>/'><?php print $product_main["merchant"]; ?></a></p>

And for your H1 tag:

<h1><?php print $product_main["name"]." ".$product_main["category"]; ?></h1>

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by wesse249 on Mon, 2016-04-18 12:50

Yes but i setup this

<?php
 
print $config_onderwerp 
?>
on more places in the schript. Sometimes i type a special word manually here. Like this:

$config_onderwerp = "special word";

and i'd like to have the ability to add manually : $config_onderwerp = "$product_main["category"]";

Do you understand me?

Submitted by support on Mon, 2016-04-18 13:06

Hello Jan,

I'm not sure I completely understand I'm afraid but it sounds like it would be sensible to have your custom config value as the fixed version, so it will be displayed anywhere that you wish to use;

<?php
 
print $config_onderwerp ;
?>

But for your product pages, use the alternative versions of your code that I posted above using $product_main["category"] instead of $config_onderwerp.

Let me know if you're still not sure and I'll try and help out further of course...

Cheers,
David.
--
PriceTapestry.com