Jump to content

DaveC

Members
  • Posts

    35
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

DaveC's Achievements

Jr. Member

Jr. Member (3/6)

1

Reputation

  1. I'd missed a crucial line of code out! Apologies for taking up your time.
  2. This 'partners-page.php' page: <?php include("./includes/header.inc"); ?> <body> <header class="navbar navbar-inverse navbar-fixed-top" role="banner"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="/"><img src="<?php echo $config->urls->templates?>img/logo.png" alt="ViveSport Logo"></a> </div> <div class="collapse navbar-collapse"> <!-- top navigation --> <ul class="nav navbar-nav navbar-right"><?php // top navigation consists of homepage and its visible children $homepage = $pages->get('/'); $children = $homepage->children(); // make 'home' the first item in the navigation $children->prepend($homepage); // render an <li> for each top navigation item foreach($children as $child) { // Exclude pages with certain names from the main navigation if($child->name != 'legal') { if($child->id == $page->rootParent->id) { // this $child page is currently being viewed (or one of its children/descendents) // so we highlight it as the current page in the navigation echo "<li class='active'><a href='$child->url'>$child->title</a></li>"; } else { echo "<li><a href='$child->url'>$child->title</a></li>"; } } } // output an "Edit" link if this page happens to be editable by the current user if($page->editable()) { echo "<li class='edit'><a href='$page->editUrl'>Edit</a></li>"; } ?></ul> </div> </div> </header><!--/header--> <!-- Page Title --> <div class="section section-breadcrumbs"> <div class="container"> <div class="row"> <div class="col-md-12"> <h1><?php echo $page->title; ?></h1> </div> </div> </div> </div> <div class="section"> <div class="container"> <div class="row"> <div class="col-sm-4"> <img src="<?php echo $config->urls->templates?>img/<?php echo $page->pageimage; ?>" alt="" class="img-responsive"> </div> <div class="col-sm-8"> <h1>testing</h1> <?php include("./includes/partners.inc"); ?> <h3>3rd test</h3> </div> </div> </div> </div> <hr> <?php include("./includes/footer.inc"); ?> </body> </html> calls this 'partners.inc' file: <?php // render the list of partners // get an array of all child pages, hidden or not, but with a template called partners-page $children = $page->children('include=all, template=partners-page'); // loop through the array and output markup for each child foreach($children as $child) { ?> <h2>5th test</h2> <div class="row"> <div class="col-md-3"> <img src="<?php echo $child->partner_logo->url; ?><?php echo $child->partner_logo; ?>" /> </div> <div class="col-md-9"> <h2>4th test</h2> <h1><?php echo $child->title; ?></h1> <p><?php echo $child->body; ?></p> <p><?php echo $child->image; ?></p> <p><a href="<?php echo $child->partner_link; ?>" target="_blank"><?php echo $child->partner_link; ?></a></p> </div> </div> <hr> <?php } ?> The .php page appears to work since the 'test' messages show up. Nothing shows from the .inc file ['5th test', title, body] apart from '4th test' which appears after the footer on the page http://www.vivesport.co.uk/what-we-offer/. Either the .inc file is not being called correctly or there is an error within the .inc file. Suggestions gratefully received. [Please don't remind me about edit/login showing - one step at a time!]
  3. And there was me thinking I was getting to grips with things! You've just left me confused with templates, template registering, and template files!!
  4. No idea! Is it a security risk? I've never used PW - not any CMS - before. Circumstances forced it upon me when I had to move my daughter's site from one host to another which would not accept PW 2.7 and the original writers could not be found. With more trial & error I suspect that there is a lot of unnecessary - and incorrect - code in and amongst the current configuration! It is certainly an interesting and frustrating learning curve!!
  5. After many hours work, investigations, and trial & error, the Our Sessions page now works!!! Thank you kongondo for all your help... ...so far!
  6. When I look at the templates in the site via ftp it does not match what PW sees: The session template is missing from the ftp [yes, it has been refreshed].
  7. I have followed your instructions. There are now some data entered. When the tabs have not been selected: - the current site shows: <div class="accordion"> <div class="accordion-section"> <a class="accordion-section-title community-club" href="#accordion-1">Badminton</a> <div id="accordion-1" class="accordion-section-content" style="display: none;"> </div> </div><!--end .accordion-section--> </div> - whereas the original site shows: <div class="accordion"> <div class="accordion-section"> <a class="accordion-section-title community-club active" href="#accordion-1">Badminton</a> <div id="accordion-1" class="accordion-section-content open" style="display: block;"> <div class="row"> <div class="col-md-12"> <div class="session"> <h3>Huddersfield Eagles Junior Badminton Club</h3> <h4>Royds Hall Sports Centre</h4> <p>Sunday - 9:00am - 12:00pm</p> <p> </p> <p><a href="https://web.archive.org/web/20180815082939/mailto:enquiries@vivesport.co.uk?subject=Huddersfield Eagles Junior Badminton Club booking please" class="btn btn-primary" target="_blank">Book this session</a></p> Clicking the current version alters nothing. When the original is clicked and opened the code starts: <div class="accordion"> <div class="accordion-section"> <a class="accordion-section-title community-club active" href="#accordion-1">Badminton</a> <div id="accordion-1" class="accordion-section-content open" style="display: block;"> So, being a great detective [!!], the accordion isn't opening!
  8. Our Sessions No No, but it's template [sessions-page] does now. Text area It does now. Text No, there's one called 'sessions-page'
  9. This is what should happen: https://web.archive.org/web/20180815082939/http://vivesport.co.uk/sessions/
  10. It's in footer.inc, should it not be in sessions.inc? [There is text within sessions.inc.] <!-- Footer --> <div class="footer"> <div class="container"> <div class="row"> <div class="col-footer col-md-4 col-xs-12"> <h3>Contact Us</h3> <p class="contact-us-details"> <b>Phone:</b> 0783 622 6545<br/> <b>Email:</b> <a href="mailto:vivesportoffice@gmail.com">vivesportoffice@gmail.com</a> </p> </div> <div class="col-footer col-md-4 col-xs-12"> <h3>Our Social Networks</h3> <p><?php echo $pages->get('/')->footer_social_text; ?></p> <div> <a href="https://www.facebook.com/VivelaSport/"><img src="<?php echo $config->urls->templates?>img/icons/facebook.png" width="32" alt="Facebook"></a> <a href="https://twitter.com/_vive_sport_"><img src="<?php echo $config->urls->templates?>img/icons/twitter.png" width="32" alt="Twitter"></a> </div> </div> <div class="col-footer col-md-4 col-xs-12"> <h3>About Our Company</h3> <p><?php echo $pages->get('/')->footer_about_text; ?></p> </div> </div> <div class="row"> <div class="col-md-12"> [reference to logins appear here, deleted as mentioned earlier] <div class="footer-copyright">© 2020 ViveSport</div> </div> </div> </div> </div> <!-- Javascripts --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="<?php echo $config->urls->templates?>scripts/jquery-1.9.1.min.js"><\/script>')</script> <script src="<?php echo $config->urls->templates?>scripts/bootstrap.min.js"></script> <!-- Scrolling Nav JavaScript --> <script src="<?php echo $config->urls->templates?>scripts/jquery.easing.min.js"></script> <script src="<?php echo $config->urls->templates?>scripts/scrolling-nav.js"></script> <script> $(document).ready(function() { $('.accordion .accordion-section-title').removeClass('active'); $('.accordion .accordion-section-content').slideUp(300).removeClass('open'); function close_accordion_section() { $('.accordion .accordion-section-title').removeClass('active'); $('.accordion .accordion-section-content').slideUp(300).removeClass('open'); } $('.accordion-section-title').click(function(e) { // Grab current anchor value var currentAttrValue = $(this).attr('href'); if($(e.target).is('.active')) { close_accordion_section(); }else { close_accordion_section(); // Add active class to section title $(this).addClass('active'); // Open up the hidden content panel $('.accordion ' + currentAttrValue).slideDown(300).addClass('open'); } e.preventDefault(); }); }); </script>
  11. Sorry, I think I have wasted your time by posing the question badly. I've got the code [site/templates/includes/sessions.inc] but it's not that what I am looking for, but how such an accordion can be inserted into and deleted from a page. I go to the 'Our Sessions' page and template and nothing about the accordion can be seen. How did it get there!! You really are being helpful, kongondo, and it is very much appreciated.
  12. However, another one I've spent a few hours trying to solve. http://www.vivesport.co.uk/our-sessions/ contains an accordion. It successfully moves between Kirklees and Calderdale, but does not open for the individual items. How do I edit what goes into each tab and how to add/delete tabs?
  13. Sorted! I was sending it to 'sessions-page' instead of 'our-sessions'. Thanks very much for you help, kongondo.
  14. I've changed it in home.php. Buttons are defined in main.css, and called via bootstrap.js. Still produces an error!
×
×
  • Create New...