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.

Is there an EE tag for the current URL?

April 01, 2011 5:45pm

Subscribe [5]
  • #1 / Apr 01, 2011 5:45pm

    David Hyland

    210 posts

    ... and when I say current I mean the page that the user is currently on 😊

  • #2 / Apr 01, 2011 6:31pm

    Rick Jolly

    729 posts

    Not that I know of. You could make a simple plugin like this:

    class Current_url
    {    
        var $return_data = "";
         
        function Current_url()
        {
            $this->EE =& get_instance();    
            $this->EE->load->helper('url');
    
            $this->return_data = current_url();        
        }
    }
  • #3 / Apr 01, 2011 6:40pm

    David Hyland

    210 posts

    Cool beans, thanks Rick!

  • #4 / Apr 01, 2011 8:20pm

    Mark Bowen

    12637 posts

    Or you could download Currentlee 😉

  • #5 / Apr 01, 2011 8:32pm

    David Hyland

    210 posts

    Thanks Mark

    In looking at that addon I also found:

    http://devot-ee.com/add-ons/current/
    http://devot-ee.com/add-ons/current-url-ee2/

    Didn’t think to look for existing addons 😊

  • #6 / Apr 01, 2011 8:58pm

    Mark Bowen

    12637 posts

    Yep there are quite a few actually but I thought I’d just post the one. Didn’t want to overload anyone with all the options out there 😉

    Very kind of Rick to post the code though, we need more of that kind of peer support in the forums lately.

    Best wishes,

    Mark

  • #7 / Apr 03, 2011 3:24pm

    Greg Salt

    3988 posts

    Hi David,

    It seems that you have a way ahead for this now. Do you still need further assistance?

    Cheers

    Greg

    @Rick and Mark, thanks very much for your help.

  • #8 / Apr 04, 2011 8:04am

    Mark Bowen

    12637 posts

    Oh I perhaps should have also mentioned that whilst there’s not one ExpressionEngine tag that specifically does what you’re after you could also use something like :

    {site_url}{segment_1}/{segment_2}/{segment_3}… and so on and so forth

    to get what you need also. Sorry I meant to mention that in my first post above.

    Best wishes,

    Mark

  • #9 / Apr 06, 2011 8:29am

    Sue Crocker

    26054 posts

    David, sounds like you have several options. Feel free to start a new thread if you have any more questions.

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

ExpressionEngine News!

#eecms, #events, #releases