Jump to content

DaveC

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by DaveC

  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!
  15. Thanks, getting there! Error message has been replaced: http://www.vivesport.co.uk/
  16. If you go to http://www.vivesport.co.uk/ all the links work apart from 'Our Sessions - Read more'. This opens a page called 'sessions'. This page does not exist, hence the error. It should direct to 'sessions-page' which does exist and can be opened from the header. How do I change the incorrect url, please? It must be so basic, yet I have spent hours trying to find out from the PW site and forum! [Ignore the errors at the bottom of the page.]
  17. Is this it [in footer.inc]? <div class="row"> <div class="col-md-12"> <ul class="nav navbar-nav footer-nav"> <?php // nav based on checkbox field foreach($pages->find('footerlink=1') as $item) { echo "<li><a href='$item->url'>$item->title</a></li> "; } if($user->isLoggedin()) { // if user is logged in, show a logout link echo "<li><a href='{$config->urls->admin}login/logout/'>Logout ($user->name)</a></li>"; } else { // if user not logged in, show a login link echo "<li><a href='{$config->urls->admin}'>Admin Login</a></li>"; } ?> </ul> <div class="footer-copyright">&copy; 2020 ViveSport</div> </div> </div>
  18. Not sure where to look. This is what Superuser sees: Error: Exception: Field does not exist: footerlink (in /vhost/vhost21/v/i/v/vivesport.co.uk/www/wire/core/PageFinder.php line 1272) #0 /vhost/vhost21/v/i/v/vivesport.co.uk/www/wire/core/Wire.php(386): ProcessWire\PageFinder->___getQuery(Object(ProcessWire\Selectors), Array) #1 /vhost/vhost21/v/i/v/vivesport.co.uk/www/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___getQuery', Array) #2 /vhost/vhost21/v/i/v/vivesport.co.uk/www/wire/core/Wire.php(450): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageFinder), 'getQuery', Array) #3 /vhost/vhost21/v/i/v/vivesport.co.uk/www/wire/core/PageFinder.php(411): ProcessWire\Wire->__call('getQuery', Array) #4 /vhost/vhost21/v/i/v/vivesport.co.uk/www/wire/core/Wire.php(386): ProcessWire\PageFinder->___find(Object(ProcessWire\Selectors), Array) #5 /vhost/vhost21/v/i/v/vivesport.co.uk/www/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___find', Array) #6 /vhost/vhost21/v/i/v/vivesport.co.uk/www/wire/core/Wire.php(450): ProcessWire\WireHooks->runHo This error message was shown because: you are logged in as a Superuser. Error has been logged.
  19. Thanks. I assume it will be _foot.php: </div><!--/#main--> <!-- footer --> <footer id='footer'> <p> Powered by <a href='https://processwire.com'>ProcessWire CMS</a> &nbsp; / &nbsp; <?php if($user->isLoggedin()) { // if user is logged in, show a logout link echo "<a href='{$config->urls->admin}login/logout/'>Logout ($user->name)</a>"; } else { // if user not logged in, show a login link echo "<a href='{$config->urls->admin}'>Admin Login</a>"; } ?> </p> </footer> </body> </html>
  20. Thank you very much for your help - and suggestions. As it's not a big site I'm more or less starting from scratch using parts of the old 'site' folder at a time so that it is easy [!] to roll back changes. I'm also using it as a brain activity - I've been meaning to learn about php & cms for a few years now, ever since people stopped wanting me to develop html sites! So once again, thank you - and I'll probably be back!! Latest: http://vivesport.co.uk/
  21. The current host didn't upgrade without telling me. The site was devised and hosted elsewhere. The original company decided that they were no longer going to be involved with websites and said that my daughter had to move the site to somewhere else. I have various static sites hosted by Easyspace so I said that I would sort things out for her. The original firm now won't talk to me, in effect saying 'tough'. They have absconded all responsibilites.
  22. 3 hours of scouring the internet, I'll ask for help here again [didn't want to take up people's time if I could wort out the problem myself]. Installed WAMP, created SQL database, set PW2.7 installation going, 'Test Database & Save Configuration': many lines of 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'vstest.modules' doesn't exist' and 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'vstest.pages' doesn't exist'. I now [after research] know how to set up tables, but I don't know specific tables for PW.
  23. Steep learning curve here! Thanks. [I've set up many static sites in the past but never progressed to dynamic ones.]
×
×
  • Create New...