HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


linking to elsewhere in the same page...?

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#91661 (In Topic #18422)
Avatar

Community saint

it used to be you could do a name= in an a tag, then elsewhere href to #whatevernameis and it would move you to a different space in the same page.    I have read more recently it is id= rather than name= …  

But I was curious if this sort of thing would work in OCP.

Specifically I dislike just about every possible 'format' that catalogs can have in terms of my FAQ's… which uses the catalogs.    So I want to do a more 'standard' format, where it lists all the questions at the top, and below it has anchors to questions with answers below them.   

Just curious if such a thing would work in OCP or not before I would dig into it.

Paul
Back to the top
 
Posted
Rating:
#91662
Avatar

It'd be a bit tricker. You'd need to template it so that the category entry boxes did two functions – one, outputting a jump link, two appending to a variable that you'd then output in the category template later on.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Item has a rating of 5 (Liked by ArboLiked by Jean)  
Rating:
#91673
Avatar

Community saint

I might be missing something, Arbo, I often do.  :$

Is this the kind of FAQ you had in mind?


You would have to add some additional code to make the search box function.

It works for my clients by simply enclosing the HTML in tags.

Code

Example FAQ Page
<h4><a name="top" id="top">Type in your Search Term</a></h4>
<!-- faqs page center content -->
<!--  EXAMPLE FORM OF FIND-IN-PAGE SEARCH USING SUBMIT (ALLOWING 'ENTER/RETURN' KEY PRESS EVENT) -->
<form action="" id="form1" onsubmit="search(this, frametosearch); return false">
  <p>
    <input type="text" name="findthis" size="15" title="Press 'ALT s' after clicking submit to repeatedly search page" />
    <input name="submit" type="submit" accesskey="s" value="Find in Page" />
  </p>
</form>
<ol>
  <li><a href="#how"><strong>How do I ... ?</strong></a></li>
  <li><a href="#where"><strong>Where can I find ... ?</strong></a></li>
  <li><a href="#why"><strong>Why doesn&#39;t ... ?</strong></a></li>
  <li><a href="#who"><strong>Who is ... ?</strong></a></li>
  <li><a href="#what"><strong>What is ... ?</strong></a></li>
  <li><a href="#when"><strong>When is ... ?</strong></a></li>
</ol>
<hr />
<div class="wrapper_faq">
  <h2><a name="how" id="how">How do I ... ?</a></h2>
  <ul>
    <li>This is the answer to the question.</li>
  </ul>
  <h5><a href="#top">Back to Top</a></h5>
</div>
<hr />
<div class="wrapper_faq">
  <h2><a name="where" id="where">Where can I find ... ?</a></h2>
  <ul>
    <li>This is the answer to the question.</li>
  </ul>
  <h5><a href="#top">Back to Top</a></h5>
</div>
<hr />
<div class="wrapper_faq">
  <h2><a name="why" id="why">Why doesn&#39;t ... ?</a></h2>
  <ul>
    <li>This is the answer to the question.</li>
  </ul>
  <h5><a href="#top">Back to Top</a></h5>
</div>
<hr />
<div class="wrapper_faq">
  <h2><a name="who" id="who">Who is ... ?</a></h2>
  <ul>
    <li>This is the answer to the question.</li>
  </ul>
  <h5><a href="#top">Back to Top</a></h5>
</div>
<hr />
<div class="wrapper_faq">
  <h2><a name="what" id="what">What is ... ?</a></h2>
  <ul>
    <li>This is the answer to the question.</li>
  </ul>
  <h5><a href="#top">Back to Top</a></h5>
</div>
<hr />
<div class="wrapper_faq">
  <h2><a name="when" id="when">When is ... ?</a></h2>
  <ul>
    <li>This is the answer to the question.</li>
  </ul>
  <h5><a href="#top">Back to Top</a></h5>
</div>



I hope that helps.
Doc
Back to the top
 
Posted
Rating:
#91677
Avatar

Community saint

Doc,

Yeah, that's what I am talking about.  Was just wondering if that would work inside of OCP, or if the links to anchors would cause a problem.

Having the code generate the anchor tags and links to them wouldn't be a problem..

Paul
Back to the top
 
Posted
Rating:
#91679
Avatar

Community saint

That is a copy from TrustServe. It works there, and several of my clients used my example to build their own FAQ page. I have never experienced a problem with it, although, I don't think any of the sites currently using that are running 9.0.2.
Back to the top
 
Posted
Rating:
#91681
Avatar

Community saint

Ah, good to know.  This is yet another 'idea' on my list of to do.   Though I will just add it as another display mode you can select in the edit catalogue dialog, and have the code to generate it.


Paul
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: