Set a we:href element via PHP

Benutzeravatar
ounos
Member
Beiträge: 44
Registriert: Mi 6. Aug 2014, 11:09

Set a we:href element via PHP

Beitragvon ounos » Di 3. Mai 2016, 13:03

I know that it's not recommended in any way but is there a way/method to set a we:href element where the value is either an internal id or an external url? Something similar to setElement().

Thank you in advance.

Benutzeravatar
blickfang
webEdition Partner
webEdition Partner
Beiträge: 812
Registriert: Mo 15. Dez 2003, 16:00
Kontaktdaten:

Re: Set a we:href element via PHP

Beitragvon blickfang » Di 3. Mai 2016, 14:18

Hi,

not sure understaning your question correctly, but you can set any var in webEdition with <we:setVar to="xy" nameto="xy">.

Timo
webEdition Partner - https://www.blickfang-media.com
Ehemals im Vorstand des webEdition e.V.

Benutzeravatar
ounos
Member
Beiträge: 44
Registriert: Mi 6. Aug 2014, 11:09

Re: Set a we:href element via PHP

Beitragvon ounos » Di 3. Mai 2016, 16:39

biwaMedia hat geschrieben: not sure understaning your question correctly
I want to set we:href using php code.

Benutzeravatar
blickfang
webEdition Partner
webEdition Partner
Beiträge: 812
Registriert: Mo 15. Dez 2003, 16:00
Kontaktdaten:

Re: Set a we:href element via PHP

Beitragvon blickfang » Di 3. Mai 2016, 21:31

try having a look at the attributes for the tag while printing it

Code: Alles auswählen

p_r(we_unserialize($GLOBALS['we_doc']->getElement($yourHrefName)));
and just do it the other way to set it

Code: Alles auswählen

$GLOBALS['we_doc']->setElement(we_serialize($yourHrefAttributesArray));
- untested -
webEdition Partner - https://www.blickfang-media.com
Ehemals im Vorstand des webEdition e.V.

mokraemer
Senior Member
Beiträge: 3619
Registriert: So 8. Aug 2010, 01:23
Wohnort: Mainz

Re: Set a we:href element via PHP

Beitragvon mokraemer » Di 3. Mai 2016, 22:07

sorry. this is not correct. href's are not serialized.
Each element (_we_jkhdsf_int,_we_jkhdsf_intID,_we_jkhdsf_extPath) is set separately and has to have type "href". Please assure to use

Code: Alles auswählen

setElement($name, $data, $type = 'txt', $key='dat')
where type has to be href and key is bdid on numeric types, as of elements int & intID

as already stated, it is not recommended to use this unless you know exactly what you are doing. Be aware that this syntax & elements are internal and subject to change without any notice between versions.
webEdition-Kern-Entwickler


Zurück zu „webEdition Basic Version“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 7 Gäste