ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

URLs for names

June 23, 2011 3:43pm

Subscribe [3]
  • #1 / Jun 23, 2011 3:43pm

    jeramiah

    301 posts

    The only complaint I think with most people is EE’s url structure.  It’s not so easy to create http://www.mysite.com/whatever  and I’m finding it’s a general complaint for people who want websites that they can’t just type in something easy it has to bee a whole thing http://mysite.com/index.php/site/whatever…blah blah blah

    I know using static pages I can do this, but what if someone wanted to do this:  Have a user register and they get their name: http://www.mysite.com/johndoe


    http://ellislab.com/expressionengine/user-guide/templates/globals/url_segments.html

    Is there anyway of removing the template group and index.php in a simple manner and then just displaying the name?

    I’m using EE 1.6.9.

  • #2 / Jun 23, 2011 5:14pm

    Rob Allen

    3114 posts

    Assuming that the “site” template group is the “default” then you can use its index template to run some conditionals to output whatever you want based on whether segment 1 is blank or not, eg:

    {if segment_1 == ""}
    This is my home page content
    {/if}
    
    {if segment_1 != ""}
    This is my user page content
    {/if}

    So if you call mysite.com/ you’ll get the home page contents, if the URL has a path, eg mysite.com/index.php/myname then it will output your user content.

    For removing index.php see thw Wiki for various methods:
    http://expressionengine.com/wiki/Remove_index.php_From_URLs/

  • #3 / Jun 23, 2011 5:42pm

    jeramiah

    301 posts

    Thank you so much for your reply!  I appreciate the help you’ve given. This might be the way to go for us.  I just wish members had permalinks or something like that where you could create a page specifically for their name etc.  But what you’ve given me is at least an option.  Thanks!

  • #4 / Jun 23, 2011 6:33pm

    Rob Allen

    3114 posts

    No problem, let us know how you get on!

  • #5 / Jun 24, 2011 5:43am

    John Henry Donovan

    12339 posts

    Hi jeramiah,

    There is a Wiki article called Cruft Free URLs which will give some more insight and tips

    Going to move this to the Community forums so if you want to update the thread you can do so.

  • #6 / Sep 25, 2012 8:16pm

    assistme

    1 posts

    Hi!

    We’ve built a service that allows Users to register on our site and choose a Username, which we take to build the User’s webpage name, or URL on our site (http://domain.com/username).

    When registering, User’s choose between 2 User Groups; each of which come with their own set of “Group” Webpage templates; unique to each of the 2 groups.

    Once registered, all Users access the same User Dashboard (http://domain.com/dashboard), within which they can click a link to “edit” their personal Web Page (http://domain.com/username). Though the template for each of the 2 User Groups contains “hardwired” content we provide, such as a “Message Me” button (for Internal User messaging), Social Network Link editing (to Twitter, LinkedIn, etc.), Users can still add their own content (text, images, background, etc).

    So, as I’ve read this post, and several others that appear to indicate EE would provide a strong platform for building this same functionality, while perhaps even allowing us to scale-up to include other add-on features we’re otherwise planning to build ourselves, I’ve received feedback from others stating that the functionality I’ve described is not possible within the EE platform. So, I’m rather confused about EE’s limitations in providing the functionality I’ve described (which appears to be possible, as this thread seems to indicate).

    Thanks for your help! Gregory

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases