Get current URL

3 views
Skip to first unread message

Phil -- wbtc.fr --

unread,
Oct 21, 2010, 12:12:44 PM10/21/10
to in-por...@googlegroups.com
Hello,

I need to retrieve the full URL of the currently displayed page. I tried to use <inp2:m_get name="..." />, but all my tests where unsuccessfull.

Thanks,
Phil.

Alexander Obuhovich

unread,
Oct 21, 2010, 1:05:06 PM10/21/10
to in-por...@googlegroups.com
Since all links are build via <inp2:m_Link .../> tag, then it should be used.

I recommend <inp2:m_Link pass_category="1"/> to ensure, that category is also passed in url.

On Thu, Oct 21, 2010 at 7:12 PM, Phil -- wbtc.fr -- <ph...@wbtc.fr> wrote:
Hello,

I need to retrieve the full URL of the currently displayed page. I tried to use <inp2:m_get name="..." />, but all my tests where unsuccessful.

Thanks,
Phil.



--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Phil -- wbtc.fr --

unread,
Oct 21, 2010, 2:31:57 PM10/21/10
to in-por...@googlegroups.com
it doesn't work, we are on an article detail page:

website.com/my-news/my-article.html

and the tag <inp2:m_Link pass_category="1"/> output

website.com/my-news/in-news/articles/article_detail.html



2010/10/21 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
Oct 21, 2010, 3:31:22 PM10/21/10
to in-por...@googlegroups.com
There are special tags, to be used on special pages, e.g. category item detail page is one of them. You should use <inp2:n_ArticleLink template="__default__"/> in this case.

Phil -- wbtc.fr --

unread,
Oct 21, 2010, 4:13:36 PM10/21/10
to in-por...@googlegroups.com
it works this time, thanks !

Then no "global tag" to retrieve URL, it's context dependant.


Dmitry A.

unread,
Oct 22, 2010, 12:36:36 AM10/22/10
to In-Portal Development Team
Yes, have thought about this too.

It might be good to have a new parameter for m_Link tag or just have a
new tag (ie. <inp2:m_CurrentUrl />) which would return the current URL
NO matter where we are. Sometimes it's needed when you trying to build
links with # and other times in JS. Basically, there are some
applications to it.

Guys, what do you think?


DA.

Alexander Obuhovich

unread,
Oct 22, 2010, 2:57:01 AM10/22/10
to in-por...@googlegroups.com
Let's don't make rush decisions here and first try to detect why <inp2:m_Link/> tag doesn't create same url on article detail page, while it does so for all other pages.

Actually <inp2:m_Link/> tag reassembles url based on url parts, that were detected from url (like category, template etc.). Maybe <?php echo $_SERVER['REQUEST_URI']; ?> is better for current page, since it will return same url, that is visible in browser (except for domain name of course).

Phil -- wbtc.fr --

unread,
Oct 22, 2010, 4:31:35 AM10/22/10
to in-por...@googlegroups.com
yes, only in-news seems to break the rule, and requesing URI seems the safer way, independant from In-Portal and modules

2010/10/22 Alexander Obuhovich <aik....@gmail.com>

Dmitry A.

unread,
Oct 22, 2010, 11:33:18 AM10/22/10
to In-Portal Development Team
The problem is that there are cases (all Catalog and Item detail
pages) when we need to think what was passed to <inp2:m_Link /> (ie.
template, prefix and so on), but I thinking about something more
static like you mentioned <?php echo $_SERVER['REQUEST_URI']; ?> which
does exactly what we need, but I would add the Domain here too.

I am not for adding a NEW tag - we can add param to m_Link one to make
it work for us. Let's say <inp2:m_Link current_url="1" /> would be
sufficient and quite fast since don't need to re-assemble the URL
(take what we have).

Just my thoughts, what you think?


DA.

On Oct 22, 3:31 am, "Phil -- wbtc.fr --" <p...@wbtc.fr> wrote:
> yes, only in-news seems to break the rule, and requesing URI seems the safer
> way, independant from In-Portal and modules
>
> 2010/10/22 Alexander Obuhovich <aik.b...@gmail.com>
>
>
>
> > Let's don't make rush decisions here and first try to detect why *<inp2:m_Link/>
> > *tag doesn't create same url on article detail page, while it does so for
> > all other pages.
>
> > Actually <inp2:m_Link/> tag reassembles url based on url parts, that were
> > detected from url (like category, template etc.). Maybe *<?php echo
> > $_SERVER['REQUEST_URI']; ?>* is better for current page, since it will
> > return same url, that is visible in browser (except for domain name of
> > course).
>

Alexander Obuhovich

unread,
Oct 22, 2010, 2:17:22 PM10/22/10
to in-por...@googlegroups.com
I would add new tag in this case, since checking for that new parameter form within m_Link tag is very expensive (from tag execution time point of view). Why check for specific parameter, that will be passed only several times at all.

Also domain adding is not necessary, since we are not building link to give to other script not on other website. But who knows, how it will be used.

Dmitry A.

unread,
Oct 22, 2010, 2:29:31 PM10/22/10
to In-Portal Development Team
I agree!

What's next?

DA

Alexander Obuhovich

unread,
Oct 22, 2010, 2:35:16 PM10/22/10
to in-por...@googlegroups.com
Let's do it, I mean let's create task and patch.

Tag name will be "<inp2:m_CurrentPageLink/>". I added "Link" and the end, so user's will know that it build a link. We already have <inp2:c_CategoryLink/> that also have "Link" at the end.

Phil -- wbtc.fr --

unread,
Oct 22, 2010, 4:25:23 PM10/22/10
to in-por...@googlegroups.com
Domain adding IS necessary, for example I planned to use this tag for a very common gadget: the "I like it" facebook button. This button add the actual page url to your facebook wall, then we must have a complete URL.

2010/10/22 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
Oct 22, 2010, 4:34:36 PM10/22/10
to in-por...@googlegroups.com
Phil, that "page url" parameter is optional to that facebook gadget. When you don't specify it, then current page is used anyway. This is what you need. Same idea with "Tweet Share" button for twitter - current url is used by default.

Phil -- wbtc.fr --

unread,
Oct 22, 2010, 4:49:01 PM10/22/10
to in-por...@googlegroups.com
ah :) ok

2010/10/22 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
Oct 22, 2010, 4:56:45 PM10/22/10
to in-por...@googlegroups.com

Phil -- wbtc.fr --

unread,
Oct 22, 2010, 5:06:13 PM10/22/10
to in-por...@googlegroups.com
thanks :)

2010/10/22 Alexander Obuhovich <aik....@gmail.com>

Dmitry A.

unread,
Oct 22, 2010, 7:15:57 PM10/22/10
to In-Portal Development Team
New task created.

99: Create new "m_CurrentPageLink" tag to return current Page URL

http://tracker.in-portal.org/view.php?id=899


I also, think we can make this tag a bit flexible from the day one
too. I propose to have the option to skip the QUERY part (kind of make
sense to have), so it can be:

<inp2:m_CurrentPageLink skip_query="1"/>

I have described that in the task already.


DA.



On Oct 22, 4:06 pm, "Phil -- wbtc.fr --" <p...@wbtc.fr> wrote:
> thanks :)
>
> 2010/10/22 Alexander Obuhovich <aik.b...@gmail.com>
>
>
>
> > More about that here:
>
> >http://developers.facebook.com/docs/reference/plugins/like
>
> > On Fri, Oct 22, 2010 at 11:49 PM, Phil -- wbtc.fr -- <p...@wbtc.fr> wrote:
>
> >> ah :) ok
>
> >> 2010/10/22 Alexander Obuhovich <aik.b...@gmail.com>
>
> >>> Phil, that "page url" parameter is optional to that facebook gadget. When
> >>> you don't specify it, then current page is used anyway. This is what you
> >>> need. Same idea with "Tweet Share" button for twitter - current url is used
> >>> by default.
>
> >>> On Fri, Oct 22, 2010 at 11:25 PM, Phil -- wbtc.fr -- <p...@wbtc.fr>wrote:
>
> >>>> Domain adding IS necessary, for example I planned to use this tag for a
> >>>> very common gadget: the "I like it" facebook button. This button add the
> >>>> actual page url to your facebook wall, then we must have a complete URL.
>
> >>>> 2010/10/22 Alexander Obuhovich <aik.b...@gmail.com>
>
> >>>> Let's do it, I mean let's create task and patch.
>
> >>>>> Tag name will be "*<inp2:m_CurrentPageLink/>*". I added "Link" and the
> >>>>> end, so user's will know that it build a link. We already have
> >>>>> <inp2:c_CategoryLink/> that also have "Link" at the end.
>

Dmitry A.

unread,
Oct 22, 2010, 7:16:57 PM10/22/10
to In-Portal Development Team
ups, task number cut a bit, correct one is below:

899: Create new "m_CurrentPageLink" tag to return current Page URL

DA

Alexander Obuhovich

unread,
Oct 23, 2010, 4:24:52 AM10/23/10
to in-por...@googlegroups.com
Since Phil's problem is solved in another way, then maybe we don't need that tag anymore?

Phil -- wbtc.fr --

unread,
Oct 23, 2010, 4:59:14 AM10/23/10
to in-por...@googlegroups.com
I was thinking this could be helpfull in some cases anyway...

2010/10/23 Alexander Obuhovich <aik....@gmail.com>

Dmitry A.

unread,
Oct 23, 2010, 11:38:17 AM10/23/10
to In-Portal Development Team
I still believe it will be useful to have.

I am for it - it's 3-4th time I feel I am thinking about having this
tag.

DA

On Oct 23, 3:59 am, "Phil -- wbtc.fr --" <p...@wbtc.fr> wrote:
> I was thinking this could be helpfull in some cases anyway...
>
> 2010/10/23 Alexander Obuhovich <aik.b...@gmail.com>
>
>
>
> > Since Phil's problem is solved in another way, then maybe we don't need
> > that tag anymore?
>
Reply all
Reply to author
Forward
0 new messages