Closed (works as designed)
Project:
Parsing API
Version:
6.x-1.9
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
28 Jul 2011 at 04:50 UTC
Updated:
28 Sep 2013 at 07:39 UTC
Me again...
Like the title says... I'm using this module to fill in a nodes title with the page title of the submitted url.
Now the problem is the I don't want the site name... How would I go about doing this considering every page title is different. some like drupal uses PAGE TITLE | SITE NAME other have it switched the other way around and others... wel do it other ways...
Maybe I'd be better of searching for the first
tag?
Any input would be great. Thank you.
Comments
Comment #1
crystaldawn commentedSeems to me that you just need some simple PHP logic. If you have the HTML of the page you want to get the title from and the title is in the format of Something | Here here is how I would approach it. The following is just a quick example, it can be optimized to be a little speedier by not running the before() and after() functions unless they are needed.
Comment #2
walker2238 commentedThanks for the reply... But the problem is when a site uses something like...
The page title | Something else | Site name
And some sites don't use any separators... Or heaven forbid bad mark up such as
<title >.Comment #3
crystaldawn commentedInteresting, I like puzzles like this. Try this instead then:
Comment #4
walker2238 commentedCool... I'll play around with it... DOM seems so much simpler though. Guess I have a lot of testing to do.
Once again thanks a lot for all your help.
Comment #5
crystaldawn commented