hybrid url

Permalink Browser Info Environment
Is it possible to use the Hybrid approach and have the buttons actually change the url, even though it just jumps to a section on the site? For SEO purposes, we need to be able to do this. Thanks.

Type: Discussion
Status: In Progress
Flora
View Replies:
jordif replied on at Permalink Reply
jordif
Hi,

this is not available out of the box, but it's possible by adding a small javascript snippet.

First, you'll need to change the name and the ID of your slides:

1. Click on each block, select "Custom Template" and enter the name of the slide into the "Block name" field (for instance "About us").
2. Click on each block, select "Design", click on the CSS tab and enter the ID into the CSS ID field (for instance "about-us").

Next, you'll need to add the following JavaScript snippet. You can add it to the custom.js file or you can paste it into one of your Content blocks (by clicking on the HTML button in the editor toolbar ):

<script type="text/javascript">
$( document ).ready(function() {
   $(".navbar ul.nav li").on("activate", function()
   {
            if(history.pushState) {
                history.pushState(null, null, $(this).find('a').attr('href'));
            }
            else {
                location.hash = $(this).find('a').attr('href');
            }
   });
});
</script>


Here is a quick demo:

http://longstoryshortparallax.15robots.com/update-url-hash...


Regards,

Jordi
Flora replied on at Permalink Reply
Flora
Thanks I'll give that a go.

Just to double-check - in the demo, you add #xxx onto the end of the url. Will this also allow me to have:
http://longstoryshortparallax.15robots.com/intro...
http://longstoryshortparallax.15robots.com/about-us...

etc. I'd be looking for the main url to change rather than append something. Will that work?

Thanks.
jordif replied on at Permalink Reply
jordif
Hi,

As far as I know, I don't think this is possible.

In HTML, links within a page (i.e. anchors) must be preceded by a hash mark (#).

I don't think you can change the main URL without jumping to another page.

Do you have any example of a website doing this?

If this is for SEO purposes, another appoach would be to actually create all those subpages. Then, include a link at the end of each slide (such as "Read more" or "Continue reading") that takes you to that subpage.

This way, users entering the main page will be able to read all the information in one page, but Google will also index all the subpages.

Hope this helps,

Jordi
Flora replied on at Permalink Reply
Flora
Yes, this is an example:http://parallax.iprospectcontent.co.uk/overview...

All info is on one page but the url changes. Is that possible?
jordif replied on at Permalink Reply
jordif
Hi Flora,

thanks for the link, that's a very interesting approach!

However this technique is pretty complex, it would be necessary to rebuild the theme to achieve this.
It requires two PHP files with duplicate content and also changes to the .htaccess file to rewrite the URLs, so I'm not sure this would work with concrete5 (which has its own rewrite rules).

If you're interested in this approach, maybe it would be easier to build the site directly in PHP, and not using concrete5.

In the article, you can also read: "In this test, it is all based on the premise that it is SEO friendly. However, we await to see exactly how search engines will treat this page and the various URL's provided."

If you search the link directly in Google, the page is not indexed:

https://www.google.com/search?q=site%3Aparallax.iprospectcontent.co....

So I'm not even sure if this technique would work (you see, the page seems to be only a test).

I'll look into it in more detail when I have some time to experiment, but in the meantime I'd recommend not purchasing the theme if you want to use this approach. It would probably be easier to build this directly in PHP.

Thanks again for the link and sorry I could not be of more help!

Jordi
Flora replied on at Permalink Reply
Flora
Ah, complicated! No problem, thanks for your help.

concrete5 Environment Information

# concrete5 Version
5.6.3.2

# concrete5 Packages
301 Redirects (2.2.2), Document Library (1.6.4), FlexSlider (2.2.0.5), Login (1.1.1), Theme Switcher (1.6).

# concrete5 Overrides
blocks/autonav, blocks/page_list, languages/de_DE, languages/tr_TR, languages/es_MX, languages/fa_IR, languages/cs_CZ, languages/it_IT, languages/nl_NL, languages/pt_PT, languages/ro_RO, languages/ar, languages/es_ES, languages/ru_RU, languages/es_PE, languages/es_AR, languages/sk_SK, languages/sl_SI, languages/nb_NO, languages/el_GR, languages/ja_JP, languages/da_DK, languages/sv_SE, languages/zh_TW, languages/vi_VN, languages/fr_FR, languages/fi_FI, models/page.php, single_pages/page_not_found.php, themes/high contrast, themes/GoldenJubileeFoundation

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - Off
Full Page Caching - Off

# Server Software
Apache/2.4.12 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4

# Server API
cgi-fcgi

# PHP Version
5.4.43

# PHP Extensions
bcmath, calendar, cgi-fcgi, Core, ctype, curl, date, dom, ereg, fileinfo, filter, ftp, gd, hash, iconv, imap, json, libxml, mcrypt, mysql, mysqlnd, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, session, SimpleXML, sockets, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zlib.

# PHP Settings
max_execution_time - 300
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 540
max_input_vars - 1000
memory_limit - 512M
post_max_size - 55M
sql.safe_mode - Off
upload_max_filesize - 55M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200

Browser User-Agent String

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.