Jump to content

statestreet

Members
  • Posts

    81
  • Joined

  • Last visited

Community Answers

  1. statestreet's post in Using a different field to generate page URLs was marked as the answer   
    Thanks Adrian!
    I decided to just tack ProcessWire's page ID on the end if the story ID is a duplicate:
    public function changeName($event) { $page = $event->arguments[0]; if ($page->template=='story' && $page->story_id!="") { if (count($this->pages->find("story_id=" . $page->story_id))) { // uh-oh, we found another page with this story ID $page->name = $page->story_id . "-" . $page->id; } else { $page->name = $page->story_id; } } }
×
×
  • Create New...