Jump to content
bfarber
 Share


IP.Content 2.0 Dev Update: Friendly URLs for Databases

IP.Content is a complex framework that allows you to create and manage website content in many different ways. You can embed blocks and databases into pages, and pages can be wrapped by templates. You can define page names and use friendly URLs through the IP.Board built-in FURL system, you can use friendly URL's through the included index.php file with IP.Content (for instance, if you want your website in the root of your domain, and the forums in a subfolder), or you can optionally not use friendly URLs at all. Because of the many configuration options, and the fact that you are already embedding a database within another friendly URL system of sorts (given that you define the filename of your page already), friendly URLs were not supported in IP.Content 1.


They will be in 2.x, however.


We have added support for databases in IP.Content 2.x to utilize friendly URLs. To make use of this support, you will need to be using an existing friendly URL method (accessing IP.Content through the included index.php file, or using IP.Board friendly URLs).

The index page of a database lists the categories contained within the database, and is accessed by accessing the page the database is embedded on. For example, if you embed your database on a page called "database.html", then you may access your category index page at

http://domain.com/database.html



In IP.Content 1.x, if you clicked on a category from this page, you would see a URL similar to the following

http://domain.com/database.html?category=1



Arguably, the URL is still "friendly", but "?category=1" doesn't really tell you much about the link you are clicking on. In IP.Content 2.x, you will now define the friendly URL name for the category by editing the category in the ACP. The upgrade process will automatically set a friendly URL name for your categories based on the category title, but you have free-reign to go back through and set the categories to be accessed as a different name if you wish. If I set the category 1 friendly URL title to be "ipb-rocks" for instance, the URL to the category is now

http://domain.com/database.html/_/ipb-rocks



Because categories are defined by administrators and we are able to do error checking while saving your category configurations, categories do not require any additional information in the URL (such as the category ID).

This page will list the records stored in the category. In IP.Content 1 those records would be accessed as follows:

http://domain.com/database.html?record=1



Again, this isn't unfriendly, but we can do a little better. Similar to topics in the forums, records will automatically inherit their title based on the specified title for the record. For instance, if the record title is "IP.Content is cool!", it will be automatically rewritten to the following URL

http://domain.com/database.html/_/ipb-rocks/ipcontent-is-cool-r1



In this instance, because titles can be duplicated and we wouldn't want to restrict record titles purely to prevent URL conflicts, we must add a marker with the ID to the end of the URL. IP.Content in turn uses this information to load up the proper record when this URL is requested. This is pretty useful in and of itself, however we went a step further.

IP.Content is used by many different customers in many different fashions. On some sites, anyone can submit to the database. On some sites, only administrators submit to the database. Because of the different configuration options, and because some databases are small and very controlled by nature, we knew that some administrators would like to remove the record ID from the end of the URL. So we built in support to do just that. If you would like to remove the "-r1" from the end of the URL in the last example, you need only login to the ACP, load up the record to edit it, and within the ACP you will have the option to specify the friendly URL for this specific record. If you manually specify a friendly URL for the record, it overrides the dynamic friendly URL and is used instead. You will not be able to set this same friendly URL for any other record, naturally, but you can edit the URLs at any time should you need to. Thus, you can turn the above record into the following URL

http://domain.com/database.html/_/ipb-rocks/ipcontent-is-cool



You may have already noticed, but it's important to note that IP.Content utilizes the category hierarchy within the URL for records, including for any sub-categories you may have configured. If you do not utilize categories for your database, that's fine as well - IP.Content will already know this and omit the category from the URL without issue.



While not related to the friendly URLs, there's something else I'd like to point out while we're discussing friendly URLs in IP.Content. You are not required to specify an extension for the pages you create in IP.Content, if you don't want to. If you didn't realize this, you can rename "database.html", in our example, to just "database" and the page will continue to function just fine. If you did so, your URL would become

http://domain.com/database/_/ipb-rocks/ipcontent-is-cool





I know some of you are going to ask about the "/_/" marker in the URLs posted above. It is not a typo. Because of the complexity and many configuration possiblities (pages can be in folders, which can be subfolders, with or without an extension, and so on), IP.Content requires some sort of "marker" in the URL so that it knows when the rest of the parameters are database information. We thought about setting some sort of word for this marker (i.e. "news") but quickly realized this isn't feasible, because everyone uses their databases for different purposes, and many of our customers do not speak English natively. Additionally, you may run one more than one database, however the marker itself is global to IP.Content. While the marker will ship as "/_/" in IP.Content 2.0, you can change it if you desire by editing a constant in an IP.Content file. We felt that having this constant was the the best way to ensure you had control over the marker, should you wish to change it, given that we cannot store this information as an ACP setting for technical reasons.



Your requests for friendly URLs in IP.Content 2.x have been heard. They will be available, and will work right out of the box based upon your existing configuration. We have much more in store, so stay tuned!

 Share

Comments

Recommended Comments


Did you mean it globally, or we can run more databases on one page?


About FURL records


Like on forums, blogs, etc... ID is first, then title.

Otherwise cool update :)

Additionally, you may run one more than one database

http://domain.com/database.html/_/ipb-rocks/ipcontent-is-cool-r1

Maybe would be better this:


http://domain.com/database.html/_/ipb-rocks/r1-ipcontent-is-cool
Link to comment
Share on other sites

Here I have a question :
So we built in support to do just that. If you would like to remove the "-r1" from the end of the URL in the last example, you need only login to the ACP, load up the record to edit it, and within the ACP you will have the option to specify the friendly URL for this specific record. If you manually specify a friendly URL for the record, it overrides the dynamic friendly URL and is used instead.

So we can remove the -r1 at the end of the URL. Ok, nice job.
But it's not possible to completely change the mask of the url ?
I mean that, for instance :


http://domain.com/database.html/_/ipb-rocks/ipcontent-is-cool

Turned into :

http://domain.com/ipcontent-is-cool.php
Link to comment
Share on other sites

Dear Sir ,
thanks for this update .
I have a question : why guest allowed to add records but not allowed to add comments ?
really I can not understand the Idea behind this setting .
if tracking guest is not possible , this must be for the both records and comments !!!

thanks .

Link to comment
Share on other sites

@Axel Wars - you can only run one database on one page. The statement you quoted was in reference to running more than one database, period. If you have a page with games database and a page with a movie database, "news" wouldn't be a good marker, for example.

I thought about putting the id at the beginning for consistency, however putting the I'd at the en is generally seen as better for SEO and I felt it was worth the divergence in this case.

I will doublecheck on the redirects. I have to touch up one or two things with FURL anyways so I'll go over it at that point

@Gros - no, that would not be possible. IP.Content can't know a URL like that is part of a database without some site-specific customizations.

@Arab Ips - you should post feedback like that in the feedback forum.

Link to comment
Share on other sites

[quote name='nshahzad' date='22 February 2010 - 06:40 PM']
Great, I just bought IPB and IPC, looking forward to all the updates. Cheers!

Great man, you'll love IPB 3.1 Im sure (as will I)! Congratulations on your purchase of IPB!! :thumbsup:

Link to comment
Share on other sites

[quote name='miikerocks' date='22 February 2010 - 09:38 PM']
Great man, you'll love IPB 3.1 Im sure (as will I)! Congratulations on your purchase of IPB!! :thumbsup:


I have three. One of them is complete suite and upgraded to business license. :tongue: IPB is doing a good job.

Link to comment
Share on other sites



Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...