link to custom field

  • Posts: 58
  • Thank you received: 5
  • Hikashop Business
10 years 11 months ago #162311

Hi.
I did create custom field for my products as WYSIWYG, where I planning to put in HTML code product details.
What I want, I like to be showing as popup link (using Lightbox) under one of my already create text field .


here is my php code:
<?php } ?>
          <td class="hikashop_product_name_row">
            <span class="hikashop_product_name">
              <?php if($this->params->get('link_to_product_page',1)){ ?>
              <a href="<?php echo $link;?>">
                <?php }
                echo $this->row->product_name;
               
                if($this->params->get('link_to_product_page',1))
    echo '</a>';
                 echo "&nbsp;&nbsp;"; 
                echo $this->row->product_info;
                  echo JHTML::_('content.prepare',$this->row->audio_sample);
              
                if($this->params->get('link_to_product_page',1)){ ?>
              
              <?php } ?>
            </span>
            <?php if(!empty($this->row->extraData->afterProductName)) { echo implode("\r\n",$this->row->extraData->afterProductName); } ?>
          </td>

echo $this->row->product_info; --- text field column name under which I want to put link.
product_details --- new to be linked column name.

I hope I did put enough info to understand.
Please help me with solution.
Thank you .

Attachments:
Last edit: 10 years 11 months ago by PeterP. Reason: Preview not working

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

  • Posts: 58
  • Thank you received: 5
  • Hikashop Business
10 years 11 months ago #162313

If I know direct link to custom field I can code this inside product_info data.
here is how can be done if I want to link to YouTube page:

<a data-lightbox="on" href="http://www.youtube.com/embed/ZpCNso_wdEQ?rel=0"><img src="images/myimg/YouTube_logo_standard_white.png" border="0" width="36" height="24" title="LINK TO VIDEO" /></a>
Copy from other already working custom field.
Here is my stuck problem: How I can replace external link to local custom field URL link?
I hope can be done. B) .

Last edit: 10 years 11 months ago by PeterP.

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

  • Posts: 58
  • Thank you received: 5
  • Hikashop Business
10 years 11 months ago #162314

I know already how to link to Article(article has external link), but I really want to be done inside product listing, is more organize, I think to use multiply language HikaShop option instead create language times product times article. :)

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

  • Posts: 83997
  • Thank you received: 13611
  • MODERATOR
10 years 11 months ago #162328

Hi,

So you want that the link opens a popup with the video of the URL inserted in a custom field to display in a player if I understand. That will require another page on the website, like a joomla article (yes) so that you can embed a Joomla extension video player in it to display the video.
I don't see another possibility as the popup has to open another page and the simplest way to have another page on your website is to create a Joomla article.

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

  • Posts: 58
  • Thank you received: 5
  • Hikashop Business
10 years 11 months ago #162404

I did the way I know.
I create html page on supporting server.
I create link in Lightbox code inside custom field product_info together with Tooltip code

<a data-lightbox="width:900" href="http://performersheaven.net/htmsupport/agnieszka.html">{tip Style creating on PA600::testing and working on Pa600,Pa800,Pa900 and Pa3x::Click for more info}Details{/tip}</a>
and is working exactly how I want :)
www.performersheaven.com/index.php?optio...g&Itemid=586&lang=en
hover on Details Style 01 and click.
But I was hoping instead using separate page I can use custom field data and store there HTML code, was be more easy to organize 1000+ inputs.
Maybe that's give you something to think for next version , some extra option :)

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

  • Posts: 58
  • Thank you received: 5
  • Hikashop Business
10 years 11 months ago #162406

nicolas wrote: Hi,

I don't see another possibility as the popup has to open another page and the simplest way to have another page on your website is to create a Joomla article.

I did try do using article, but Article in pop window using URL link is opening with entire menus and other modules, I want only Simple HTML page.

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

  • Posts: 58
  • Thank you received: 5
  • Hikashop Business
10 years 11 months ago #162408

If you be kind and give me idea how I can translate word Details using Joomla translation.
this string is inside the code. :unsure:
I'm really have no clue how to approach to this .
custom HTML pop page I decide to leave static for all language (to much to translate) :)
but the word "Details" is visible next to all other words already translated.
Thanks

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

  • Posts: 83997
  • Thank you received: 13611
  • MODERATOR
10 years 11 months ago #162429

Hi,

Since that text is in a custom product field, The best would be to enter in your custom field only a translation key like DETAILS_FOR_PRODUCT_1 and then add a translation override:

DETAILS_FOR_PRODUCT_1="<a data-lightbox='width:900' href='http://performersheaven.net/htmsupport/agnieszka.html'>{tip Style creating on PA600::testing and working on Pa600,Pa800,Pa900 and Pa3x::Click for more info}Details{/tip}</a>"
for each one of your languages, and finally editing the view file to replace the code:
echo $this->row->product_details;

with :
echo JText::_($this->row->product_details);

and that should do it.

The following user(s) said Thank You: PeterP

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

  • Posts: 58
  • Thank you received: 5
  • Hikashop Business
10 years 11 months ago #162461

Yeah, that's will work, only thing is I have to do so many overwrite translations. :huh:
You are programmer, so you know the goal of programming... make simple is possible, using some catchy fix script and make global,
Thank you anyway , is still solution.
for now I maybe use, but my thinking was: you already have default fields, for example product code which is linking to product details, if I can somehow clone code with customize changing and make simple custom field link_to call "Details" and on back end text box with address to be linking was be cool, I can sacrifice tooltip, is not really that imported .
You think is possible?

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

  • Posts: 58
  • Thank you received: 5
  • Hikashop Business
10 years 11 months ago #162466

I did try using custom field "link" , but after I input working URL on Back End , on front end I see only text, not clickable.
Do I miss something, do I need include <a href> syntax ? :unsure:

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

  • Posts: 58
  • Thank you received: 5
  • Hikashop Business
10 years 11 months ago #162470

B) I did figure out link field.
has to be syntax, I did put

<a href="http://performersheaven.net/htmsupport/agnieszka.html" target="_blank" title="Click for more Info">Details</a>
and I came to started point. :dry:
still need many translations, unless I try instead text box try use WYSIWYG and try to add Language switch above on Back end. B)

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

  • Posts: 13201
  • Thank you received: 2322
10 years 11 months ago #162474

Hi,

To avoid all these translations, you can potentially use the code:

echo '<a href="'.$this->row->product_details.'" target="_blank" title="Click for more Info">Details</a>';

And in the product custom field just put the link to the desired page.

The following user(s) said Thank You: PeterP

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

  • Posts: 58
  • Thank you received: 5
  • Hikashop Business
10 years 11 months ago #162554

Thank you Xavier.
I didn't try yet but this is very good idea, but still need Translation key only 1 for each language.
Translate : "Click for more Info" and "Details" strings.
I making strong coffee now and I will jump on this, see how this will work. B)

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

  • Posts: 58
  • Thank you received: 5
  • Hikashop Business
10 years 11 months ago #162557

well... :unsure: I still need professional help :)
here is my code:

<td class="hikashop_product_name_row">
            <span class="hikashop_product_name">
              <?php if($this->params->get('link_to_product_page',1)){ ?>
              <a href="<?php echo $link;?>">
                <?php }
                echo $this->row->product_name;
               
                if($this->params->get('link_to_product_page',1))
    echo '</a>';
                 echo "&nbsp;&nbsp;"; 
                echo  $this->row->product_info;                  
                echo JHTML::_('content.prepare',$this->row->audio_sample);
              
                if($this->params->get('link_to_product_page',1)){ ?>
              
              <?php } ?>
            </span>
            <?php if(!empty($this->row->extraData->afterProductName)) { echo implode("\r\n",$this->row->extraData->afterProductName); } ?>
          </td>
I working on this line: echo $this->row->product_info;
I like Xavier idea, but also I want to include my Translation key.
My thinking is : replace: echo $this->row->product_info; for echo JText::_($this->row->product_details);
and in translation : instead link somehow put other variable : custom field : style_details_link
and then in this field put just URL address.
I'm not sure if I can include PHP code in translation :unsure:
I'm kinda lost here
I will trying testing , but if you know how can be done, I will appreciate

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

  • Posts: 58
  • Thank you received: 5
  • Hikashop Business
10 years 11 months ago #162579

kinda stuck :(

echo '<a href="'.$this->row->style_details_link.'" target="_blank" title="Click for more Info">Details</a>';
Is possible instead Details there put translation key: PRODUCT_DETAILS ?
something like :
echo '<a href="'.$this->row->style_details_link.'" target="_blank" title="Click for more Info"><?php echo JText::_( 'PRODUCT_DETAILS' );?></a>';
I'm running of clues :(
or maybe add some script like:
If langage = ENG then:
echo '<a href="'.$this->row->style_details_link.'" target="_blank" title="Click for more Info">Details</a>';
if language =POL then:
echo '<a href="'.$this->row->style_details_link.'" target="_blank" title="Klick po wiecej info">Szczegoly</a>';
end if
something like that. :unsure:

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

  • Posts: 83997
  • Thank you received: 13611
  • MODERATOR
10 years 11 months ago #162711

Here is a simple solution:

Keep the solution you had with the HTML

<a data-lightbox="width:900" href="http://performersheaven.net/htmsupport/agnieszka.html">{tip Style creating on PA600::testing and working on Pa600,Pa800,Pa900 and Pa3x::Click for more info}Details{/tip}</a>
in the custom field and instead of:
echo $this->row->product_details;

use that code:
echo str_replace('Details',JText::_('DETAILS'),$this->row->product_details);

Then, you can simply have such translation override, one per language:
DETAILS="Details"

The following user(s) said Thank You: PeterP

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

  • Posts: 58
  • Thank you received: 5
  • Hikashop Business
10 years 11 months ago #162722

I not following you :(
this code going where?

<a data-lightbox="width:900" href="http://performersheaven.net/htmsupport/agnieszka.html">{tip Style creating on PA600::testing and working on Pa600,Pa800,Pa900 and Pa3x::Click for more info}Details{/tip}</a>
is going to custom field or translation?
can you tell me all including php code in table_listing.php ?
to make sure we on same page:
Detail is static only translate
tooltip " Style creating on PA600::testing and working on Pa600,Pa800,Pa900 and Pa3x::Click for more info" is variable input in custom field product page (this I like to be translate, but if is to much I will skip translation)
Beside I can create for tooltip translation key for each Language, is going to be only few version
I can do something like: TOOLTIP1, TOOLTIP2 etc and translate
URL address is variable, every style has different set of sounds,STSs, Pads etc... everyone gonna has own HTML page as a info

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

  • Posts: 83997
  • Thank you received: 13611
  • MODERATOR
10 years 11 months ago #162729

I said I my message that the HTML code has to go in the custom field.
And I gave you the PHP code to include in your view: echo str_replace('Details',JText::_('DETAILS'),$this->row->product_details);
So you already have the answers to your questions.
And yes, we're on the same page.

The following user(s) said Thank You: PeterP

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

  • Posts: 58
  • Thank you received: 5
  • Hikashop Business
10 years 11 months ago #162816

Thank you Nicolas.
Is working .
for now I leave how is it,
I need to improve few other things more imported.
later I will try to somehow translate ToolTip msg, but not now.
B)
BTW Preview is working now on this forum :woohoo:

Last edit: 10 years 11 months ago by PeterP. Reason: missspell

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

Time to create page: 0.151 seconds
Powered by Kunena Forum