Newspublisher question

Dear Bob Ray,

Ive a question according to Newspublisher 2.1.
Ive added the duplicate button ( &duplicatebutton=1) which does not work well for me because of a pagetitle issue:
The pagetitle for the new docs should always stay the same but it is connected seo friendly url which doesnt allow duplicate urlnames of course.
Normally my newspublisher creates docs with 8digit-numbers which are no problem for friendly urls instead of taking the pagetitle so Im wondering why it takes the pagetitle by duplicating the doc.
Is there any workaround? I have that in a running system with lots of content.

Thanks for your help,
Stefan

Iā€™m afraid I donā€™t understand your question. The ā€œDuplicateā€ button creates an exact duplicate and shows it to you in NewsPublisher so you can edit any of the fields (including the pagetitle).

Iā€™m not clear on exactly what you would like it to do.

Thats absolutely clear.
But the thing in my case is that the exact same pagetitle is needed on all the duplicates.
So if I have a pagetitle ā€œtestā€ in original, the seo name will be test.html.
When I duplicate the post and have to keep ā€œtestā€ as pagetitle, it will be again test.html and that url is not accepted twice. So Im looking for a workaround.

Have you tried changing the allow_duplicate_alias System Setting?

No, because I think this will cause trouble when I have 2 or more pages with the exaxt same name?
The newspublisher ressources are all saved in the same directory ā€¦

It sounds like you want duplicate pagetitles but different aliases.

If thatā€™s it, you can add the alias field to NewsPublisher and put whatever you want in it.

Or maybe Iā€™m still misunderstanding you.

No, youā€™re understanding correct.
But is there another work around to prevent user to put in an alias?
Because of usability ā€¦ alias is more technical stuff and I dont want to stress ppl with that ā€¦

Not that Iā€™m aware of. There is the auto-alias setting, but that would give you a duplicate alias.

Itā€™s possible to create some JavaScript that would populate the alias field when the pagetitle is filled in, but to avoid duplicates, it would have to call a custom processor to see if the alias already exists.

Possibly upon duplication have a lightbox or step in the process ask the user for a ā€˜unique nameā€™ for new template, and then check the name against the aliases in the treeā€¦

Or, yeah find some way to create one automatically, all that is needed is to add 3 random numbers to the original aliasā€¦but it would still need to check for availability or an error is possible, and those numbers wonā€™t help SEO

@sspind something like making a new alias out of the userā€™s username and the original alias would at least limit the possibility of duplicate alias

This is an interesting problem. Clearly the new alias has to be guided in, as we donā€™t just want randomness, but then we must check for dupsā€¦

It occurs to me that NewsPublisher calls the resource/create or resource/update processor when you save a resource. Both of those fire the ā€˜OnBeforeDocFormSaveā€™ and ā€˜OnDocFormSaveā€™ events.

If you can figure out what you want to do for the alias (e.g. add username, hashed username, current time and/or date, PHPā€™s uniqid(), etc.) , you can do it in a plugin attached to one of those events. All resource fields are available there and the resource object will be available as $resource.

1 Like

Thanks so much for your help!

1 Like

Iā€™m glad I could help. :slight_smile:

1 Like