Search

I’ve got a section whose entries each map to a separate page. In order to pass each entry to its page I’ve done the following.

  • Set the title of each page to the target entry’s system ID
  • Setup a single DS that filters the entry IDs against {$page-title}

This works fine but I’d like to have friendlier and more meaningful titles than ‘17’ or ‘23’ when I’m looking at Blueprints>Pages.

Is there a way to use titles like ‘Home #7’ and ‘Process #18’ and then filter my DS against just the portion after ‘#’?

If your field supports regex filtering in the DS, then the following should work

regex: \s#(.+)$

This should look for any characters after the last space and hash in the title, you may need to check that though, my regex is a little rusty.

On a side note, have you tried the Pages Field extension, to link entries to specific pages, then filter on that value matching the current page

$current-page

May be easier…

Thanks designermonkey.

I’ve been looking at using a regex filter but my understanding is that if I select ‘System ID’ for the filter item then the regular expression is applied to the entries’ IDs. How do I tell the filter that it needs to look at the {$page-title} parameter, pull out the segment identified by the regex, and then use that to select an entry from the database?

I’ve been reading the forum threads about ‘static page’ handling and might restructure things to use the Pages Field but I still want to know how to solve this problem.

That’s a good point. Doh!

You may have to customise the datasource, but I’m not the man for that…

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details