A href URL with div ID wildcard - url

Is there a way to open a page and jump to a div ID when only part of the ID is known?
eg: http://wp-site.com/webpage.php#div-id-name-xxxx
where 'xxxx' is a set of numbers that are impossible to know until after the page has loaded.
I'm using a shortcode which generates a page element within a div where the beginning of the ID is standard (eg: tabs-bottom, contact-form, etc) followed by a unique number that is randomly generated each time the page loads.
I want to be able to link to the div on that page from another page, but with part of the ID being dynamic, I'm having trouble doing so. I thought passing a wildcard in the URL might be the way to go...
Any ideas?
ps: the pages are part of a Wordpress based site, if that helps.

Related

Generate dynamic URL pages basis filter options in Rails

We have a rails app at remote.tools and if you see the product pages (see this page), there are a set of tags associated with each product. I am planning on having filtered search basis these tags on category pages (see this page). Now, I have already tried doing this with the 'Acts-as-taggable' gem and 'Simple-form' (basis this blog).
I am fine with having a page refresh on hitting 'search' or doing it in place (able to do both right now). However, I want to have unique URLs to be created basis the combination of filters applied by the user. For example, if the user selects 'Video communication tools' as the category and 'free trial' and 'easy-to-use' as the tags, the page URL should be '/video-communication-tools-with-free-trial-that-are-easy-to-use'. Currently, the filter options are passed as params i.e. '/search?category=xx&tags=yy'.
Having separate URLs for filter combinations will allow me create unique pages for indexing and add content contextually as well.
How should I go about doing this?
You can use jquery to achieve that,
Something like this.
<script>
$('#search_button').on('click', function(){
window.location = "" + $('#tag1').val()+"-"+$('#tag2').val();
});
</script>
Make sure to add id in your search button. Hope this works for you.

Navigate in timeline to a specific year/month AND post (facebookID) with a single url

I noticed that with a URL of the format
facebook.com/username/timeline/2013/4
we move to the end of the specified month of the year.
Now I need to use an url to navigate a user in my timeline to a specific post (facebookID) in a way that he can still move up and down on timeline from this point of time (anchor).
Any clues?
On a Facebook page, each post's HTML element has its own unique HTML id.
You can make use of this fact to directly link to a post within a page on Facebook by identifying the post's id and using it as the fragment identifier in the URL.
To find a post's HTML element id, right click the particular post in your browser [I'm assuming Chrome], then click "inspect element". In the opened development environment, find an enclosing div of the inspected element which contains an id HTML attribute.
For example, a link to a particular post on Disney's March 2013 Facebook timeline is the following:
https://www.facebook.com/Disney/timeline/2013/02/#tl_unit_6154529015953642023

What is the meaning of # in URL and how can I use that?

I often found some URL which looks like the following:
www.something.com/some_page/#someword
After writing this page some_page will be open and then scroll will be set so that I can see that "someword" at beginning of my screen.
I don't know what the meaning of "#" is. As soon as I make #someotherword with any URL it works sometimes and sometimes it doesn't.
I am not getting what # is in the URL. Is it any functionality of any language or URL or something else?
It might be possible that you consider my question newbish, but I am not into web-designing technologies, I am simply curious about it.
I am not the owner of some website, but when I am concerned with some particular portion of some web page then how can I give the URL with # and give that URL to another?
I am concerned with the answer portion on my profile, and then I will prepare the URL just below and will give it to somebody.
https://stackoverflow.com/users/775964/mr-32#answers
This works, but some time it doesn't.
https://stackoverflow.com/users/775964/mr-32#tags
That doesn't work.
I am just a user and I don't want to know in which language the website is build.
Originally it was used as an anchor to jump to an element with the same name/id.
However, nowadays it's usually used with AJAX-based pages since changing the hash can be detected using JavaScript and allows you to use the back/forward button without actually triggering a full page reload.
This is known as the "fragment identifier" and is typically used to identify a portion of an HTML document that sits within a fully qualified URL:
Fragment Identifier Wiki Page
It is an anchor for links within a page - also known as "anchor tag"
http://www.w3.org/TR/html4/struct/links.html#h-12.2.3
It specifies an "Anchor", or a position on the page, and allows you to "jump" or "scroll" to that position on the page.
Apart from specifying an anchor in a page where you want to jump to, # is also used in jQuery hash or fragment navigation.
Anchor with an id
Dead link Hash or fragment navigation
Tips for better fragment navigation
Yes, it is mainly to anchor your keywords, in particular the location of your page, so whenever URL loads the page with particular anchor name, then it will be pointed to that particular location.
For example, www.something.com/some_page/#computer
if it is very lengthy page and you want to show exactly computer then you can anchor.
<p> adfadsf </p>
<p> adfadsf </p>
<p> adfadsf </p>
<a name="computer"></a><p> Computer topics </p>
<p> adfadsf </p>
Now the page will scroll and bring computer-related topics to the top.

HTML Urls - how to append to the existing url

This is a stupidly easy question, however after searching for a long time I have yet to yield any results.
My question is as follows.
I have a webpage with the url http://domain.com/mypage/ladeda/
I have a link on this page.
Page 1
That link sends me to http://domain.com/1/
Page 1
That link takes me to http://domain.com/mypage/1/
How do i get my link to take me to http://domain.com/mypage/ladeda/1/
without having to extract all the aspects of the page url and put them within the href.
Many Thanks
<base href="/mypage/ladeda/" />
...
(goes to http://domain.com/mypage/ladeda/1/)
Via the <base> element.
But!
Page 1 should take you to http://domain.com/mypage/ladeda/1/ already provided that (a) you don't use a <base> element already and (b) the current resource is really http://domain.com/mypage/ladeda/ (with a trailing slash).
Page 1
If the current page isn't in the same directory (real or virtual) as the target page, you're going to have to specify a complete path. Either relative, or absolute. There's no way around it.

How can I remove body from a Page in OrchardCMS?

I currently have 2 page types in my Orchard CMS setup. One is for the front page, one for a detail page. On the front page, I have removed the body from being displayed, so that it just shows 2 HTML widgets.
Is there a way so that when someone edits this page, they don't get a body section?
A placement file might also do the trick: placement also works for the admin ui... That could enable you to make it show or not without requiring two different content types.
You can remove the Body Part from the page content type you use for the front page. This way people who edit this page won't see the editor for body content and the body won't be rendered at all.
HTH

Resources