Welcome Guest, Not a member yet? Register   Sign In
SEO Friendly Blog Titles (link)
#21

[eluser]IamPrototype[/eluser]
What I wanted to do was that everytime I enter a entry, the META title would be edited to something like "<entry_name> | Domain.net".. the problem is that I "include" my top.php in the controller (loading the view).. so how can I make it that the entry title pops up in the top.php? And if I go to another page like "About me" it changes to "About Me | Domain.net". I know I just can enter the segment code in the META title, but that would cause a huge code, or what?

An example could be the CI Forum, the META title.
#22

[eluser]John_Betong[/eluser]
&nbsp;
Hi alectrash,
&nbsp;
Am I missing the point or not seeing something important?
&nbsp;
I think the code can be replaced with:
Code:
?php $title = url_title('A man goes to', '_') ?&gt;

  // produces: http://localhost/joke/search_title/a_man_goes_to
&nbsp;
Question for the MySql Gurus:

What happens when the title has ... appended? I cannnot find the link
&nbsp;
&nbsp;
#23

[eluser]xwero[/eluser]
Since this thread is going in all directions i want to show a nice example on how to have SE friendly and at the same time user friendly urls.

http://www.makeuseof.com/tag/13-alternat...ogle-cant/ : nice SE url but no way i'm going to type/remember the whole url as a surfer. So i type http://www.makeuseof.com/tag/13-alternative-search and i get the same page.

I guess this is done with a like statement instead of an equal statement, and i'm sure the redirection will have a 301 error for the bots.
#24

[eluser]IamPrototype[/eluser]
Wow, that's a nice URL that website got there!
#25

[eluser]Erwin Setiawan[/eluser]
I have my own idea to make http://yoursite.com/blog/some-post-title-here/
first make your new column url_title on your posts table to save url title and make it unique
then just use this function on url helper:

url_title()

Takes a string as input and creates a human-friendly URL string. This is useful if, for example, you have a blog in which you'd like to use the title of your entries in the URL. Example:
Code:
$title = "What's wrong with CSS?";

$url_title = url_title($title);
// Produces: whats-wrong-with-css

then use url_title($title); for where clause with unique url_title column
how about this? Smile
#26

[eluser]drewbee[/eluser]
One other suggestion: just the way I do it so I don't have to pass another param, Is I let the program make the assumption that the first number in the string is the id
ex.

/blog/view/23-i-caught-my-wife-cheating-red-handed.html

a simple explode by -, grab the first item, then glue her back together. I know, I know, a few more steps then to simply add another param, but hey why not.




Theme © iAndrew 2016 - Forum software by © MyBB