Keyword

[SOLVED] Anchors Causing Pages to Break:

  • Timothy Michel
  • Timothy Michel's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 3 months ago - 10 years 3 months ago #129922 by Timothy Michel
[SOLVED] Anchors Causing Pages to Break: was created by Timothy Michel
You can view the page at: www.jsandbox.org/557-news-releases/368-behind-the-smoke-curtain.html

The links appear on a separate page because I needed to have someone look at this so I had the links open in a new page, but still the page is broken because of the links look at: www.jsandbox.org/557-news-releases/368-behind-the-smoke-curtain.html#note-1

What I need is for the reader to be able to click on the reference to the footnote, read it, then click on the return link which takes them back to the point in the article where the link to the anchor existed to continue their reading. I plan to create an Extra Fields group for this that adds the ability to add up to 64 footnotes.

Does someone have an idea why these anchors are behaving the way that they do is it possibly because the url, www.jsandbox.org/557-news-releases/368-behind-the-smoke-curtain.html , has
#note-1
tagged on the end of it? Is there a way around this problem?

Sorry I can't include the html because the forum SPAM filter won't permit it. You will just have to do a view source on the pages I reference above.

Please Log in or Create an account to join the conversation.

More
10 years 3 months ago #129923 by Lefteris
Replied by Lefteris on topic Re: Anchors Causing Pages to Break:
Hi. Something must be wrong with your template. As you can see the page is rendered normally with the system template www.jsandbox.org/557-news-releases/368-behind-the-smoke-curtain.html?template=system#note-1 .

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Timothy Michel
  • Timothy Michel's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 3 months ago #129924 by Timothy Michel
Replied by Timothy Michel on topic Re: Anchors Causing Pages to Break:
Thanks you are right, all the HTML for the page is present. The problem probably exists in item.php as all other views work properly. I will look to see what I did. I added a Sub-Titles Extra Field and had those subtitles display below the title, Perhaps when I did that I inadvertently broke the display of anchors.

Please Log in or Create an account to join the conversation.

  • Timothy Michel
  • Timothy Michel's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 3 months ago #129925 by Timothy Michel
Replied by Timothy Michel on topic Re: Anchors Causing Pages to Break:
Here is the php that I added/changed in item.php, As you can see I created a new loop under the echo of the main title that filters for Subtitle 1 and Subtitle 2 to display them with h3 and h4 tags respectrively and echo the contents of the extraField value.
		<?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
		<!-- Item article SubTitle 1 extra field -->		
			<?php foreach ($this->item->extra_fields as $key=>$extraField): ?>	  	
				<?php if($extraField->name != '' && $extraField->name == 'Subtitle 1'): ?>
					<h3 class="itemSubTitle1"><?php echo $extraField->value; ?></h3>
				<?php endif; ?>
			<?php endforeach; ?>
		<?php endif; ?>
		<?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
		<!-- Item article SubTitle 2 extra field -->
			<?php foreach ($this->item->extra_fields as $key=>$extraField): ?>	  	
				<?php if($extraField->name != '' && $extraField->name == 'Subtitle 2'): ?>	  	
	  				<h4 class="itemSubTitle2"><?php echo $extraField->value; ?></h4>
				<?php endif; ?>
			<?php endforeach; ?>
		<?php endif; ?>	

And then below I filter for Sub Title 1 and Sub Title 2 again to exclude them from being displayed where extraFields are normally displayed.
		<?php foreach ($this->item->extra_fields as $key=>$extraField): ?>	  	
			<?php if($extraField->value != '' && $extraField->name != 'Subtitle 1' && $extraField->name != 'Subtitle 2'): ?>	  	
		  	<ul>
				<li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">
					<?php if($extraField->type == 'header'): ?>
					<h4 class="itemExtraFieldsHeader"><?php echo $extraField->name; ?></h4>
					<?php else: ?>
					<span class="itemExtraFieldsLabel"><?php echo $extraField->name; ?>:</span>
					<span class="itemExtraFieldsValue"><?php echo $extraField->value; ?></span>
					<?php endif; ?>
				</li>
			</ul>			
			<?php endif; ?>
		<?php endforeach; ?>

But I don't see how this would affect navigation to an anchor like #note-1.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 3 months ago #129926 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Anchors Causing Pages to Break:
Your code looks fine. PHP code will not cause this behaviour.
This is a css issue.

I commented out .row-fluid { overflow: hidden; } template.css line 5424 and it worked.
I am sure there must a more elegant solution than editing Bootstrap's classes.

Try removing overflow: hidden; from another container and see if that soles the issue as well.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Timothy Michel
  • Timothy Michel's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 2 months ago - 10 years 2 months ago #129927 by Timothy Michel
Replied by Timothy Michel on topic Re: Anchors Causing Pages to Break:
Krikor, thanks again. It is really great to have someone send me in a direction other that the php rut I was only digging ever deeper.

I still have a php issues in referencing extra fields, but at least now, after reviewing the php manual again and from the observations you made, I think I can solve the problem and get the extra fields to display even though "Extra Fields" item in "category item view" in the "Category" interface are set to off. I have to do that because I can't have the regular "Extra fields" displaying in category item view, I just want Title Row 2, Subtitel 1 and Subtitle 2 to display. that was another post.

Thanks again, hope things are going well for you.

One other thing, if it is in template.css, it is already a bootstrap override so I won't have to edit bootstrap directly. I will look for the most elegant solution. Thanks for sending me in the right direction.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 2 months ago #129928 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Anchors Causing Pages to Break:
You 're welcome Timothy.

You 're right you shouldn't edit Bootstrap. You can override it in your template.css file

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Timothy Michel
  • Timothy Michel's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 2 months ago - 10 years 2 months ago #129929 by Timothy Michel
Replied by Timothy Michel on topic Re: Anchors Causing Pages to Break:
On line 342 of template.css I changed "overflow: hidden" to "overflow: visible" in the row-fluid over-ride. That fixed the problem as you suggested it would.

What I really need is a good footnote editor for the JCE editor. Unfortunately none exists. This is 2014, I should be able to hover on a footnote reference in an article and see the text of the footnote, which is what I did in this instance by using the"title=" attribute, and click on the footnote and go to the fully qualified footnote in the footnote section at the bottom of the article and then click again on the footnote and return to my original position in the article. I see a process of creating all the footnotes that will appear in the article in advance and then just putting my cursor at the position in the article where I want the numerical reference to the footnote to appear and then select from the available footnotes in the pop-up that appears when clicking the footnote tool in the tools tray of, in this instance, the JCE editor. Of course there is the gotcha of having multiple references to the same footnote; to what position do we return to in the article in this case. More code to provide a pop-up that gives the available choices of where in the article the reader came from.

If you know of a good footnote plugin, let me know.

Thanks again. I think we can declare this issue solved however.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 2 months ago #129930 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Anchors Causing Pages to Break:
Hmm if your JS skills are good I would use a tooltip from jquerytools.org , or since you are using Bootstrap I would see which components are installed and how I can use them.
Bootstrap offers many JS components, some are bound to help you.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Timothy Michel
  • Timothy Michel's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 2 months ago - 10 years 2 months ago #129931 by Timothy Michel
Replied by Timothy Michel on topic Re: Anchors Causing Pages to Break:
That isn't a bad idea, but I have to create an application that can be used by authors on the site who have zero JS, HTML or CSS knowledge. The application would have to be completely menu driven.

It would have to work like extra fields, where there would be something like 64 text boxes, each corresponding to a footnote so that the author can add up to 64 footnotes per article which will then be processed and added at the end of the article with sequentially numbered anchors. Now with the JCE editor there is a links plugin that has dialogue boxes for "url," "text," and a menu for linking to content, contacts, etc. and below that is a drop-down that lists all page anchors present in the document so that a link to the anchor can be created by a select and click process, Clicking on a tool in the editor selecting a footnote from a drop-down box and clicking on insert to insert a numeric footnote reference at the cursor in the article is what I need for people who will work on this website.

Certainly JS would be handy for making a modal, lightbox effect window pop up when the footnote reference is clicked, I can even add in some cool fade in an out effects, but I would still need to create an application to provide the author a menu for adding the footnotes; that would need to be done in php.

Using Bootstrap classes makes creating the modal popup even easier, but still I won't be there to add the code to the page, I will need to create an application that does this transparently behind the scenes.

I am just gong to use what I have right now until I get this website operational and then I will come back and work on automating this process. I may have to write a plugin for the JCE editor but then I get to learn how to write plugins.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum