Force content

classic Classic list List threaded Threaded
11 messages Options
Gil
Reply | Threaded
Open this post in threaded view
|

Force content

Gil
This post was updated on .
Hello everyone,

So you can check my website with the script on:
http://www.cynaptek.com/Portfolio.html


Here is an example of my links:
<a href="http://www.cynaptek.com/Portfolio/3D/maison-jouet-knauf.html" rel="maison-jouet-knauf" class="mosaic-backdrop"></a>

The rel attribute change for every links as you can see on the website

To activate shadowbox I generate this:
Shadowbox.setup('a[rel="maison-jouet-knauf"]', {
		content:        "http://www.cynaptek.com/imgup/knok-maison.jpg",
		player:			"img",
		title:			"Maison réalisée pour Knok Design. Image réalisée à partir d'une base illustrator.",
		gallery:        "portfolio",
		continuous:     "true",
		counterType:    "skip"
    	});

in a windows.onload at the end of the page.

The purpose of this is to have links to a new page and not to a content. So google will be able to see each content as a new page, thanks to URL rewriting.


The issue I have is that right now of I go to this page:
http://www.cynaptek.com/Portfolio.html
and I click on one link, shadowbox open but don't find any content (which I specify in the script).

But if I go to this page:
http://www.cynaptek.com/Portfolio/3D/chateau-de-chevetogne-en-3d-photorealiste.html
the script will load and find the content with the exact same parameters except I call for a Shadowbox.open in this case.


Edit 1 : After a few test by for example changing the player by 'iframe' for every links I saw that shadowbox doesn't take the content I specify but the href from my link as the content.

Edit 2 : I think I need to use the Shadowbox.buildObject but doesn't know how right now...

Edit 3 : Every time I try to make use buildobject, firebug tells me it's not a function.
I tried to call it by Shadowbox.buildObject('a[rel="maison-jouet-knauf"]',"http://www.cynaptek.com/imgup/knok-maison.jpg");

and also to just replace the "Shadowbox.setup" by "Shadowbox.buildObject" but it doesn't work either...
Gil
Reply | Threaded
Open this post in threaded view
|

Re: Force content

Gil
Could someone give an example of how to use Shadowbox.buildObject ?

With the latest version 3.03 it seems I can't use the function to create the objects.
Reply | Threaded
Open this post in threaded view
|

Re: Force content

arttronics
Move the shadowbox.js , shadowbox.css, and shadowbox.init items to the HEAD section of your page, and in that order. Shadowbox init needs to be done prior to any content you want in it.

Move the window.onload so that it's the last thing in your head section. you might have to create a separate function for the Shadowbox item and call that function in window.onload

I think that should work.

When posting your markup here on the forum follow these simple steps:

0. Login and paste your markup into the Message Box.
1. Mouse select the markup you just pasted.
2. Press the More Button from the Message Box Toolbar.
3. Select Raw text from the drop down menu. DONE!

If I don't respond to your POST, it's your inability to provide your markup correctly.

Check out a few DEMOS I made that are here in this forum.

Gil
Reply | Threaded
Open this post in threaded view
|

Re: Force content

Gil
Thanks for the answer.


I made the test but it doesn't work, the result is exactly the same.

Shadowbox open every link by taking the content of href as the main content and not the one I specify.



You can check the code here: http://www.cynaptek.com/test.php


I also tried the way you setup your home page with the function setupDemos() and the result is also the same.

You can check the code here: http://www.cynaptek.com/test2.php
Reply | Threaded
Open this post in threaded view
|

Re: Force content

arttronics
I looked at both new links you provided but am confused why you think this approach is necessary. I guess I am not understanding what it is you want to accomplish.

In your original post you stated "The purpose of this is to have links to a new page and not to a content." except realize that a link to a new page is content for Shadowbox.

Looking at your markup, I tried to access several of the href HTML links that you have listed, and it does update to the correct href location except all the page contents are identical.

If your goal is to have images loaded into Shadowbox, but you want to load a HTML via URL so that it's Search Engine friendly, why not just use the Shadowbox iframe player and specify image size. That way each href is a unique URL that will in turn load the image into shadowbox. If that is your intentions then you can address each unique HTML page so that it mimics the auto-scaling of Shadowbox IMG Player.

If you need help to understand the BuildObject method, see my other post.

P.S. You wrote "I also tried the way you setup your home page" except I don't have a home page... I am a visitor to this site like you.

When posting your markup here on the forum follow these simple steps:

0. Login and paste your markup into the Message Box.
1. Mouse select the markup you just pasted.
2. Press the More Button from the Message Box Toolbar.
3. Select Raw text from the drop down menu. DONE!

If I don't respond to your POST, it's your inability to provide your markup correctly.

Check out a few DEMOS I made that are here in this forum.

Gil
Reply | Threaded
Open this post in threaded view
|

Re: Force content

Gil
This post was updated on .
In reply to this post by Gil
Thanks again for your help,

I thought you were an admin or something :).


So what I want to do in the end is to have normal links like now but when someone click on a link I don't want the page to change, I just want shadowbox to load. If people just share the link I provide so I want to make shadowbox.open(content) like it's working now.


Why to do that?
Like u said, I want to do something that the search engine (google) will understand. I thought it was better that way and I will conserve the URL rewriting I'm doing. I also want to activate the gallery function...


With the solution of iframe I will have to create real html page with one image per example then if someone just share the url to this page he won't have the whole design and will think he is out of the website.


That's why I try to specify the content in the Shadowbox.setup but it seems that if shadowbox is launching from a link he will take the href as the main content and I can't change that.


I also looked at your answer with your example but since I want to have real links to the website I don't know how it can help me. Maybe the solution would be to have a normal link right now but with your exemple in the onclick to "override" the href function and launch the shadowbox instead of opening the link.

Again, thanks for your help and I hope you will understand what I'm trying to do :).



Edit: After some test with your example I won't be able to activate the gallery since the contents are not correctly setuped/loaded into the cache.
Reply | Threaded
Open this post in threaded view
|

Re: Force content

arttronics
I am not familiar enough with SEO to help you with your problem, but here are a few points.

The use of a virtual href HTML page may or may not have any impact on that SEO process, I am guessing that it needs to be a valid HTML page for it to be of any use as the file itself must exist.

Here's something to consider... even if you devise a method so that the virtual href is not used as Shadowbox content and the actual ".jpg" content is, the direct link Google provides to such URL will bypass the Shadowbox implementation use of that link.

I did read an article a couple of weeks back that the use of folder paths plays a big roll in SEO, so perhaps you can mimic the href URL using such paths instead of the generic path to the content you have now. Each and every folder slash leading to your content is SEO friendly! Perchance naming The.File.Like.This.html can also make a difference.

The use of the iframe does not require a dedicated HTML page. However here is something worth mentioning: You can use the Shadowbox IMG Player via the rel attribute for a renamed JPG image file extension.

1. Rename photo.jpg to photo.html
2. Use rel="shadowbox;player=img;" for the renamed content.
3. Now you have a HTML page fit for SEO (but it's not HTML, it's a JPG!) that loads into the Shadowbox IMG player.
4. The drawback to #3 is the SEO will provide a direct link to such HTML page, and when a visitor clicks that link it will show garbled JPG file contents. Perhaps using page-redirect or some other control mechanism (page hi-jack, cough-cough) might work, but there are browser-safe protections in use.

I'm afraid I am out of ideas, tell us what worked out for you in the end.

When posting your markup here on the forum follow these simple steps:

0. Login and paste your markup into the Message Box.
1. Mouse select the markup you just pasted.
2. Press the More Button from the Message Box Toolbar.
3. Select Raw text from the drop down menu. DONE!

If I don't respond to your POST, it's your inability to provide your markup correctly.

Check out a few DEMOS I made that are here in this forum.

Gil
Reply | Threaded
Open this post in threaded view
|

Re: Force content

Gil
In the end I made a trick.

Since I'm generating everything with php, what I did is that I have 2 links for the content.
One regular link with an href like this: "http://www.cynaptek.com/Portfolio/3D/pub-joassin-animation-3d.html"

So google is happy.
And I made a second link like this:


So the link is shadowbox friendly and I make a setup like this one:
Shadowbox.setup('a[rel="pub-joassin-animation-3dbis"]', {
		content:        "http://www.youtube.com/embed/izNH4bzl4BU",
		player:			"iframe",
		title:			"Réalisation de la publicité 3D, diffusée sur Canal C Namur, sur le thème de Cars pour Joassin.",
		width : "640", 
		height : "360",
		gallery:        "portfolio",
		continuous:     "true",
		counterType:    "skip",
    	});


The only thing is that shadowbox doesn't load right away, the page has to change then shadowbox open (with a shadowbox.open cmd). But the gallery is functioning and everything looks fine for me.


Too bad that with the Shadowbox.Setup we can't force the content to display. It would have been easier and cleaner this way.


Thanks again for your help !

You can see the result here: http://www.cynaptek.com/Portfolio.html
Reply | Threaded
Open this post in threaded view
|

Re: Force content

arttronics
Shadowbox is not loading right away because you have a page re-direct occurring.

Upon completion of the new page that is loaded, Shadowbox is automatically launched and shows a dark iframe player until all contents have been loaded.

You want to force the contents of the Shadowbox iframe Player to show right away you ask?

Here is how.

When posting your markup here on the forum follow these simple steps:

0. Login and paste your markup into the Message Box.
1. Mouse select the markup you just pasted.
2. Press the More Button from the Message Box Toolbar.
3. Select Raw text from the drop down menu. DONE!

If I don't respond to your POST, it's your inability to provide your markup correctly.

Check out a few DEMOS I made that are here in this forum.

Gil
Reply | Threaded
Open this post in threaded view
|

Re: Force content

Gil
I think the problem was that since shadowbox took the href which was an iframe and that I was setuping shadowbox with the image or youtube player I had the loading png showing up but no content.

But I didn't want to use the iframe player I just wanted regular content and having the possibilites to have regular link.
Reply | Threaded
Open this post in threaded view
|

Re: Force content

Valdespino4
In reply to this post by arttronics
Oh! I think Google Adwords Campaign Management will be able to help you with it. I am taking their help presently for advertising my business online and on social media. I am sure they are good at everything related to this. You can give it a shot and maybe your problem is solved.