PDA

View Full Version : Vbphrases - how do i register from template instead of php


Vaupell
02 Dec 2009, 21:39
EDIT : read last post first please.. :D

*** original post ***
got some old phrases

like this

$vbphrase[Euclength] and when i use that it places the lang value for me in english which i have as "length"

so now i want to make it work for vb4, cause atm it just shows the actual phrasecode.
so i change it from

$vbphrase[Euclength]

to

{vb:raw vbphrase.Euclength}

but now it comes up empty as if it dosent retrive the data..
any ideas what im doing wrong ?
cause ive changed a few others they came out just fine.. so im guessing my syntax is fine.

BBR-APBT
02 Dec 2009, 21:40
You have to register the phrase group.


Edit:
Try it like this.

{vb:phrase Euclength}

Vaupell
02 Dec 2009, 21:42
You have to register the prhase group.

in the specifik template ? cause i pulled 2 other phrases from same group that
came out just fine.

BBR-APBT
02 Dec 2009, 21:45
I edited my post above.

Vaupell
02 Dec 2009, 22:09
code snippet...

i tryed 3 types where i could only retrive data correctly from the first one vb:raw......


<tr align="center">
<td class="thead">{vb:raw vbphrase.EucTitle}</td>
</tr>
</thead>
<td class="tcat" align="center">{vb:phrase Euclength} {vb:rawphrase Eucconvert} TEMP** Length</td>
<!-- Code start -->
<tr><td>

and heres a shot of the phrases i use..
107094
and they all contain data, have all been open and save, just in case..
how ewer if i change the Length or convert to vb:raw they come up empty..
only the title have been working..

only change from title to the next part, is the table, and table class for styling.
gonna try to remove all the classes just to check..

BBR-APBT
02 Dec 2009, 22:16
So you are saying that this worked:
{vb:raw vbphrase.EucTitle}


But the following two did not work?

{vb:phrase Euclength}
{vb:rawphrase Eucconvert}

Vaupell
02 Dec 2009, 22:18
So you are saying that this worked:
{vb:raw vbphrase.EucTitle}


But the following two did not work?

{vb:phrase Euclength}
{vb:rawphrase Eucconvert}


yes excaktly. and to make things worse...

if i make this

{vb:raw vbphrase.Euclength}


it does not work.. and location means nothing, tryed to copy the working one to the
other location and there it worked fine aswell..

So im starting to think maybe my phrases are "broke" going to make some new
to test if a new one would work.. :confused:

BBR-APBT
02 Dec 2009, 22:23
You know I started to think the phrases break on upgrade to 4.0 when I had problems the other day. I had to make a new phrase my self it was the only way to get it to work for me.

So yeah I was just about to say delete the old ones and make new ones. Should not have a problem then.

When I made my new phrase I just did it like this.
{vb:phrase Euclength}

Vaupell
02 Dec 2009, 22:24
omg.. found out what the hell is going on. . :D


the phrase that are working is registrere as global while the rest are in category
for the product.


so i need to register the product phrase group to make them work..
see img. 107095

and since moveing to templates from php

i used to call the phrasegroup inside the php file not the template :D

$phrasegroups = array('EviUnitConvert',
);

any suggestions on calling it in vb4 ?

BBR-APBT
02 Dec 2009, 22:27
omg.. found out what the hell is going on. . :D


the phrase that are working is registrere as global while the rest are in category
for the product.


so i need to register the product phrase group to make them work..
see img. 107095

I said that in the beginning.

You have to register the phrase group.

Vaupell
02 Dec 2009, 22:39
Was really hopeing to get rid of the .php file
any suggestions on registrering the phrasegroup from the templates ?


$phrasegroups = array(EviUnitConvert);

im sure they didnt let something like that slip, with the new system ?

EDIT : Note it works fine using a php file, would just be much nicer distribution
in a single .xml product file.. ;)

BBR-APBT
02 Dec 2009, 23:47
any suggestions on registrering the phrasegroup from the templates ?


If you have a on off var the plugin would be something like this. With the hook location of init_startup

if ($vbulletin->options['evi_unit_convert_active']){
$GLOBALS['phrasegroups'][] = 'EviUnitConvert';
}


What you really need is:

$GLOBALS['phrasegroups'][] = 'EviUnitConvert';