Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2010-09-21 11:15:35

helmz
Member
Registered: 2010-09-14
Posts: 65

Re: Fancybox and Textpattern

solved… ty guys

the code im using:

<a id="inline" href="#inline1">click</a>
<a name="inline1">
<div id="fancybox-inner" style="top: 10px; left: 10px; width: 400px; height: 100px; overflow: auto; display:none;">
   <div style="width: 400px; height: 100px; overflow: auto;" id="inline1">
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis mi eu elit tempor facilisis id et neque. Nulla sit amet sem sapien. Vestibulum imperdiet porta ante ac ornare. Nulla et lorem eu nibh adipiscing ultricies nec at lacus. Cras laoreet ultricies sem, at blandit mi eleifend aliquam. Nunc enim ipsum, vehicula non pretium varius, cursus ac tortor. Vivamus fringilla congue laoreet. Quisque ultrices sodales orci, quis rhoncus justo auctor in. Phasellus dui eros, bibendum eu feugiat ornare, faucibus eu mi. Nunc aliquet tempus sem, id aliquam diam varius ac. Maecenas nisl nunc, molestie vitae eleifend vel, iaculis sed magna. Aenean tempus lacus vitae orci posuere porttitor eget non felis. Donec lectus elit, aliquam nec eleifend sit amet, vestibulum sed nunc.
    </div>
</div>
</a>

Offline

#14 2010-09-30 11:38:27

helmz
Member
Registered: 2010-09-14
Posts: 65

Re: Fancybox and Textpattern

I post it here, Im using this code with Fancybox but its not working as it should

<a class="fancy" <txp:image id="6"/> 
<txp:thumbnail id="6" />
<script>
$('a.fancy').fancybox();
</script></a>

Ty.

Offline

#15 2010-09-30 12:17:30

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Fancybox and Textpattern

You’ve left off the closing bracket for the opening a tag, and omitted the space before the closing slash in the image tag. You’ve left out the required type attribute for the script. Whether or not you’re using Fancybox correctly I have no idea, because I know nothing about that script.


Code is topiary

Offline

#16 2010-09-30 20:48:03

helmz
Member
Registered: 2010-09-14
Posts: 65

Re: Fancybox and Textpattern

Have this and still not working:

<a>
<a class="fancy" <txp:image id="6" /> 
<txp:thumbnail id="6" /></a>
<script>
$('a.fancy').fancybox();
'transitionIn'    :    'elastic',
        'transitionOut'    :    'elastic',
        'speedIn'        :    600, 
        'speedOut'        :    200, 
        'overlayShow'    :    false

</script></a>

Now where can be the problem. I must say that is into a slideshow that when u do <a></a> it takes it like 1 image, so if i put 2 <a> its like 2 images… and take the text like it was an image

Last edited by helmz (2010-09-30 20:49:41)

Offline

#17 2010-09-30 22:05:31

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Fancybox and Textpattern

Missing brackets around your fancybox settings.

 $('a.fancy').fancybox({
        'transitionIn'    :    'elastic',
        'transitionOut'    :    'elastic',
        'speedIn'        :    600, 
        'speedOut'        :    200, 
        'overlayShow'    :    false
});

More examples on Fancybox site.

Last edited by MattD (2010-09-30 22:06:50)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#18 2010-09-30 22:29:41

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Fancybox and Textpattern

helmz wrote:

Have this and still not working:

You didn’t fix the issues Jeff pointed out and you ended up adding more issues.

  1. Now you have two links tangled together.
  2. The link (a elements) opening tag still doesn’t have closing tag.
  3. Scripts’ mandatory type attribute is missing.
  4. The additions you made to JavaScript don’t do anything atm. You should be feeding them to the function, now they just cause parsing errors.
  5. You are not link to anything, nor telling fancybox to what content to show in the box. TXP’s image tag doesn’t output URLs, if that is what you are trying. It outputs imgs.

Now, then. What are you trying to do? What output? What should the Fancybox show? Start by Reading Fancybox’s How-to, and take look at the examples and tips.

For example, this, what you tried:

$('a.fancy').fancybox();
'transitionIn'    :    'elastic',
        'transitionOut'    :    'elastic',
        'speedIn'        :    600, 
        'speedOut'        :    200, 
        'overlayShow'    :    false

Doesn’t do anything. If you want to feed options to Fancybox, you need to feed them, not just place the lines somewhere. As Matt said, for example:

$('a.fancy').fancybox(
    {
        'transitionIn' : 'elastic',
        'transitionOut' : 'elastic',
        'speedIn' :    600, 
        'speedOut' : 200, 
        'overlayShow' : false
    }
);

You also probably should initialize the code on page load and centralize the code in the page’s head segment or in external javascript file.

All-in-all, we get something like this:

<script type="text/javascript">
    $(document).ready(function(){
        $('a.fancy').fancybox(
            {
                'transitionIn' : 'elastic',
                'transitionOut' : 'elastic',
                'speedIn' : 600, 
                'speedOut' : 200, 
                'overlayShow' : false
            }
        );
    });
</script>
<a class="fancy" href="/some/content/to/link.png.etc">
    <txp:thumbnail id="6" />
</a>

Last edited by Gocom (2010-09-30 22:35:19)

Offline

#19 2010-10-01 08:11:26

helmz
Member
Registered: 2010-09-14
Posts: 65

Re: Fancybox and Textpattern

and what if I need the first image in the first href?

thanks :)

Offline

#20 2010-10-02 11:04:32

helmz
Member
Registered: 2010-09-14
Posts: 65

Re: Fancybox and Textpattern

anyone knows?

Offline

#21 2010-10-02 12:18:34

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Fancybox and Textpattern

You shouldn’t bump a thread without providing more information. I know this is difficult if English isn’t your first language, but to get help you’ve got to try harder.

Your code examples have all shown a single image, so it isn’t clear what you’re asking by “what if I need the first image in the first href?” Are you trying to set up a slideshow, i.e. a succession of images in the same Fancybox? Or do you want a set of images each of which triggers its own Fancybox? In either case it will have to be someone who knows more about Fancybox than I do who gives you the answer, but that’s the kind of information you need to provide.


Code is topiary

Offline

#22 2010-10-02 15:32:49

helmz
Member
Registered: 2010-09-14
Posts: 65

Re: Fancybox and Textpattern

Ok… I write it better:

I have this code

<a class="fancy" href="/some/content/to/link.png.etc">
    <txp:thumbnail id="6" />
</a>

Ok. Now I dont want to get this image

href="/some/content/to/link.png.etc"

I want this

<txp:image id="6" />

How can i do that? Thanks.

Last edited by helmz (2010-10-02 15:33:08)

Offline

#23 2010-10-02 15:44:03

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Fancybox and Textpattern

In the code you show you have hard-coded the image id, so you can do the same with the href:

<a class="fancy" href="/images/6.png">
    <txp:thumbnail id="6" />
</a>

This assumes you have kept the default name of images for your Txp image directory, and that your site root is also the domain root (i.e., not a subdirectory).

For a more generalized solution, where you don’t know the image id in advance, you would need either a plugin or the new image tags in Txp 4.3.0, which hasn’t been officially released yet.


Code is topiary

Offline

#24 2010-10-04 08:13:37

helmz
Member
Registered: 2010-09-14
Posts: 65

Re: Fancybox and Textpattern

That’s it, ty.

Offline

Board footer

Powered by FluxBB