Hello,
is there any way to rename a wE document using we tags or php code ?
Thank you in advance
Document rename
Re: Document rename
currently we don't have a tag for this. if you really need this:
I don't really think you should rename files on the fly, but if you have to, the above code should do the magic.
Code: Alles auswählen
<?php
$err=$GLOBALS['we_doc']->we_unpublish();
$GLOBALS['we_doc']->Filename="myNewName';
if(!$err){
$err=$GLOBALS['we_doc']->we_publish();
}
if($err){
echo 'we had a problem during publish, e.g. duplicate filenames';
}
webEdition-Kern-Entwickler
Re: Document rename
Maybe I should be more specific: I need a custom document name when I use <we:write type="document"> tag instead of the default id number. Is there a better solution than the one you provide ?
Thank you very much for the fast response.
Thank you very much for the fast response.
Re: Document rename
jepp, this should be the name Attribute, which I can see is undocumented
webEdition-Kern-Entwickler
-
- Senior Member
- Beiträge: 1319
- Registriert: Do 22. Mai 2003, 23:25
Re: Document rename
is the name attribute also available for documents? That would be nice!
Re: Document rename
Hm, it seems that 'name' attribute doesn't do anything.mokraemer hat geschrieben:jepp, this should be the name Attribute, which I can see is undocumented
Re: Document rename
I didn't check that attirbute for rename, but it is in effect on new object's.
@Elko: not now - I just discovered that attribute and it's only used for new created objects. I should give Andreas a hint for the documenation - but maybe it would be a good idea to have a better name for this attribute and maybe we can achieve a rename procedure for this too.
Can one of you post a feature request to the ticket system?
@Elko: not now - I just discovered that attribute and it's only used for new created objects. I should give Andreas a hint for the documenation - but maybe it would be a good idea to have a better name for this attribute and maybe we can achieve a rename procedure for this too.
Can one of you post a feature request to the ticket system?
webEdition-Kern-Entwickler
Re: Document rename
So, for now the only way to rename a document is using the php code from your first post ?
Anyway, thank you so much for your time and I hope the same functionality will be possible for documents also in the future.
Anyway, thank you so much for your time and I hope the same functionality will be possible for documents also in the future.
Wer ist online?
Mitglieder in diesem Forum: 0 Mitglieder und 0 Gäste