I added a new field in a template (<we:select>). This new field is included in the order fields of a listview.
Of course, there are a lot of existing documents based on this template.
Is it possible to update (not manually of course) all these documents' new field with a default value, so that I can order them properly ?
Now, the value of this field is empty (I guess) for existing documents and they are not even displayed in the listview.
Thank you in advance.
listview order
-
- webEdition Partner
- Beiträge: 1825
- Registriert: Di 7. Mär 2006, 16:50
- Wohnort: Wien
- Kontaktdaten:
Re: listview order
Hi,
Sascha
- In Editmode: Check if the value is set. If not, set the attribute "selected" for the default option.
- In NotEditmode: Check if the value is set. If not, apply your default value as a fallback.
Sascha
Re: listview order
To whom it may be interested, I had to create a new template and use it as a script in order to bulk update existing documents:
Code: Alles auswählen
<we:listview name="myListview" type="document" doctype="myDoctype">
<we:repeat>
<we:field name="WE_ID" to="global" nameto="docID"/>
<?php
$doc = new we_webEditionDocument();
$doc->initByID($GLOBALS['docID']);
$doc->setElement('myElement', 'myValue');
$doc->we_save();
$doc->we_publish();
?>
</we:repeat>
</we:listview>
Wer ist online?
Mitglieder in diesem Forum: 0 Mitglieder und 0 Gäste