Support Forum

Please note that this forum is only available to you in read only mode. In order to contribute to this conversation you will need to renew your subscription.

How can I use anchor tags within sections between pagebreak code

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

For many years and with two different templates I have been using and updating a page that opens showing several named pagebreak categories. (for instance <hr class="system-pagebreak" title="EXHIBITIONS" />) Everything works fine, but I want to link to a particular paragraph within the page using an anchor tag and it doesn't work. The page break sections stay closed. The browser link/url doesn't change whether the pagebreak links are open or not, so the # tag before the anchor tag doesn't work.

The link to the page is this: www.mainefiberarts.org/fiber-bulletin

No doubt you will look at it with firebug or "inspect element" and you will also see another bane of my existence, the span tags that get inserted any time I edit something directly in the JCE: <span style="background-color: transparent; line-height: 1.3em;">

So if you can't explain how to open the page break elements/tags/links (whatever they are) so I can use anchor tags, do you have any idea why this horrible span tag with the background color and line height is being applied without me doing anything?

I welcome any help you can provide. I suspect you will recommend using ZenTools2 and use accordions ????? Which I have thought of but I suspect that will produce similar unknowns for me.

Carol Jones
  • palominojones's Avatar
  • palominojones
  • 3 Month Basic
  • 265 posts
  • 2 Thanks
  • Karma: 0
The administrator has disabled public write access.
Hi Carol,

Sorry the delay on our response - re internal anchors - do you get the same if you use a standard Joomla template?
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
With the previous templates was the content in accordions?
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Regarding

<span style="background-color: transparent; line-height: 1.3em;">

That could be if you are copying and pasting from within the editor

With any inline style (excluding specific tags like strong, italic) it will be wrapped in span tags

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
I have never wanted an anchor tag before, somewhere I heard they are bad so I haven't tried using them in another template. I did read about turning off validating html and was able to seemingly get an anchor tag to work that was right before one of the page break headings, but I need to get the headings to open so the content drops down and then goes to the anchor tag. That seems to be controlled by javascript coming from Joomla somewhere.

Yes, I do copy and paste within the editor sometimes. That would explain those unwanted and unplanned span tags. Thanks.
  • palominojones's Avatar
  • palominojones
  • 3 Month Basic
  • 265 posts
  • 2 Thanks
  • Karma: 0
The administrator has disabled public write access.
Internal anchors are fine - they are just links

You can target the current page and even combine them with links to target parts of a different page

The problem here is you want the accordion to open which would be javascript - which isn't controllable by the anchor tag

I'll need to check with the team on this one

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
It is easy to do that in the editor - even by accident

Cheers
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Yes, javascript. I have a module that lets me put it in if I knew what it was. I used this custom code module and put in some javascript in another article in a "loadposition" on the page and it worked fine.
  • palominojones's Avatar
  • palominojones
  • 3 Month Basic
  • 265 posts
  • 2 Thanks
  • Karma: 0
The administrator has disabled public write access.
Hi Pam,
I think you would need some custom javascript to get this to work. And thats probably bets added to the templates js/script.js file in zgfv4 themes or thejs/template.js file in T3 templates.
Thanks
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
Thank you. I wouldn't know where to start to add js to the template. It is too far over my head and outside my interest scope. But I can see in the "inspect element" code page that it seem to be calling for javascript void: (0) or something like that. Doesn't seem like a likely script.

I also see that there is a div tag with a class called "pane-slider content pane-down" when it is open, or "pane-slider content pane-hide" when it is closed. So maybe I would have to put that div code somewhere near or around or before the anchor tag link to get to the paragraphs within that div? That's as far as my brain will let me go. These dropdowns are part of the joomla core I think, just an hr tag called page break when there is really not a page break.

Bottom line. I can live without the anchor link.

Thank you anyway,

Carol (not Pam)
  • palominojones's Avatar
  • palominojones
  • 3 Month Basic
  • 265 posts
  • 2 Thanks
  • Karma: 0
The administrator has disabled public write access.
Sorry for the delay on a reply

I'm a bit unclear what you are wanting to do with the latest post

Can you clarify?

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
My last post was basically that I was giving up. But of course I can't. I am haunted by my inability to do this.

So I've been researching on the web for other people wanting to do exactly what I want to do, but they refer to opening an accordion and everyone has trouble, mostly the discussions I found were about Wordpress and I got sick of reading.

What I have on my page is not called an accordion, but it is a clickable link that does not change the top URL in the address bar. The html created by clicking on this "page break" button at the bottom of the JCE editing window is a line of code like this: <hr class="system-pagebreak" title="OPPORTUNITIES" /> which you can see on this page: www.mainefiberarts.org/fiber-bulletin.

So is seems to be just a styled horizontal rule. Right?

I want to create a URL/link (something that starts with www.mainefiberarts.org/...) that I can paste into another page on the same site (or any other one) or an email that will go to the "OPPORTUNITIES" heading and open it to reveal the content below.

Is this impossible? It is apparently over my head but it should be possible. If I need javascript where do I find it? I am not a code writer and just know the basics.

Does this make sense?

Thanks,

Carol Jones
  • palominojones's Avatar
  • palominojones
  • 3 Month Basic
  • 265 posts
  • 2 Thanks
  • Karma: 0
The administrator has disabled public write access.
Hi Carol,

That is an accordion, the link is just the trigger to open the panel containing the information.

To do that you would need some way of knowing that the user wanted to see part of the accordion.
You can do that by adding a parameter to the link to the page, something like:
http://domain.com/page?accordion=5

Then you would need to use javascript/php to check for the parameter in the url and then trigger a click on the correct link to open the panel.

Regards,

Rob
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
Hi Rob,

Either I'm not explaining very well (in spite of more emails that I want to send or than you want to read), or I don't know what you are talking about (likely) or this is the kind of thing I have to pay a coder to do for me.

But if I can't explain what I want to do in the first place then I will never be able to achieve what I want, whether paying someone or figuring it out myself.

These "accordions" are created with the content-pagebreak extension built into Joomla since version 1.7 I think. The links are called sliders and it is a way to view a long article divided into "pages." That is what I understand.

I tried various combinations of what you recommended with the parameters you suggested related to what I thought was correct for my page (the id of the pane/accordion/link I want to open is article203-sliders5 and there is a div class of pane-hide or pane-down) but nothing I tried will open it.

If I need javascript, where does it go and what is it and how do I get it to work with a simple html link from another page or an email. There is tons of javascript on that page, but I don't know how it relates to putting something in the URL that will toggle that accordion/slider/pagebreak open.

I can put an anchor tag above the link I want to open, and when I type in www.mainefiberarts.org/fiber-bulletin/#opportunities as the URL/link and sometimes (like on the iPhone) it will scroll the page down so that all the accordion links are visible, while without the #opportunities the top of the page appears at the top. I also put an anchor link after the OPPORTUNITIES link called #opportunity which does nothing.

I would be happy if I knew how to put something in a URL that would trigger that one accordion/slider/link (sliders5) to drop down and make all the content under it visible.

Is that possible or not? If it is possible, given that I don't know how to do it, who can I ask to make this happen? If it is not possible, please tell me it is not possible.

When I google this I find the same question going back to 2005, 2009 and Joomla 1.5. Some forum answerers say it can't be done.

Sorry to be so obtuse, but I just want to be clear on whether this is possible before I totally give up.

Thanks,

Carol Jones
  • palominojones's Avatar
  • palominojones
  • 3 Month Basic
  • 265 posts
  • 2 Thanks
  • Karma: 0
The administrator has disabled public write access.
Hi Carol,

Yes this functionality requires custom javascript. It would be added to the js/scripts.js file but it's beyond the scope of support to provide that here.

What you would describe to a coder would be:

I want to be able to open a specific accordion on the page using a url fragment. The fragment would look something like what Rob posted above.

It's a relatively easy task for someone who knows how to do it.

Thanks
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
OK. Thanks.

Carol
  • palominojones's Avatar
  • palominojones
  • 3 Month Basic
  • 265 posts
  • 2 Thanks
  • Karma: 0
The administrator has disabled public write access.
Good luck with it

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers