Quick Nav:  Online Store   |   Login | Register

Title & Description

Rate this topic:

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
AuthorMessages
DavidWSnow
<250Posts
Posts:177


09/21/2007 4:24 PM  

John,   As I recall you said that the DNN PageBlaster could move text from a location on the page into the Title and Description Meta-tags.

I assume that the locations would have to have a CSS id="New-Title" to identify them.  This was for Google's benefit, since it would be easy to do with Javascript for real users.  I read the PB manual, but didn't see how I might accomplish this.

/DaveS

John Mitchell
Posts:3084


09/21/2007 4:40 PM  
You can move text around in the page by creating a Regex to capture and replace. So yes, as long as you had the title in a div or some other element that can be easily captured then you could create a regex rule that would replace the output with it moved into the title element.

If you had your title tag in a DIV element with an attribute called "title", you would create a rule like this:


SearchFor:  <title>.*?</title>(.*?)<div.*?id="title".*?>(.*?)</div>
ReplaceWith:  <title>$2</title>$1


DavidWSnow
<250Posts
Posts:177


09/23/2007 3:34 PM  

 

 

With the comments removed gives yeallow screen of death complaining about "*" 

Since I can't see the page generated I'm not sure how to debug this.

On a related issue the pages that I want to do this on have URLs like

http://localhost/asi3/tabid/263/Default.aspx?vRecordId=553

If I wanted a Friendly URL rule or PageBlaster rule to make them more friendly how would I do that?

/DaveS

John Mitchell
Posts:3084


09/23/2007 3:40 PM  
In Regex, make sure if you are using an asterisk that you have a period before it.
DavidWSnow
<250Posts
Posts:177


09/23/2007 3:49 PM  

You do. I am using the exact string you have in this post except that I am using h1 rather than a div.

I just got my perl book out and refreshed myself on regex.

Why do you have both an * and ?    doesn't .* mean any character 0 or more times and the ? mean 1 or more times?

Is what I am looking at in the post altered by the process. I tried to enter the H1 and DIV with the brackets and it really messed up the post.

 Update:

I fixed the yellow screen of death but the actual supsitiution is taking place here is the rule.

 

Replace Title
                    .*?(.*?)(.*?)]]>
                    $2$1]]>
                 
 

 

 

My code gets eaten in this post even if it is formated as "code". How did you make your orifinal post?

/DaveS

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.



ActiveForums 3.7
Powered by: Snapsis Software