Jump to content

Marty Walker

Members
  • Posts

    629
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Marty Walker

  1. Hi Joss,

    Why not design it from scratch? I understand that BS and Foundation are fast starting points but don't they just complicate things by having to sift through all their code to work out what does what? Not to mentioning loading code you never use.

    BTW on your Stony site there's a typo in the footer: Site Design ©2012 Stony Webistes

    • Like 5
  2. Hi all,

    I've had this site running for a while now but the client has just noticed that when they perform a site search on certain terms they're getting no results.

    Eg: http://theinfantshome.org.au/search/?q=family+day+care

    ... which should return results to a number of pages including this one: http://theinfantshome.org.au/our-services/early-education-care/family-day-care/

    I'm using the stock standard search template code from the default PW installation (see below), none of the pages I'm searching for are hidden and there's no Access management enabled on the templates.

    What's even more odd is if I search for 'family day care' in the PW admin I get no results either yet that page title exists. But if I search for 'family' that page gets returned in the results.

    I'm running the latest (non-dev) build too: 2.3.1

    Any help really appreciated.

    Regards

    Marty

    <?php
    
    /**
     * Search template
     *
     */
    
    $out = '';
    
    if($q = $sanitizer->selectorValue($input->get->q)) {
    
    	// Send our sanitized query 'q' variable to the whitelist where it will be
    	// picked up and echoed in the search box by the head.inc file.
    	$input->whitelist('q', $q); 
    
    	// Search the title, body and sidebar fields for our query text.
    	// Limit the results to 50 pages. 
    	// Exclude results that use the 'admin' template. 
    	$matches = $pages->find("title|body|sidebar~=$q, limit=50"); 
    
    	$count = count($matches); 
    
    	if($count) {
    		$out .= "<h2>There are $count pages matching your query:</h2>" . 
    			"<ul>";
    
    		foreach($matches as $m) {
    			$out .= "<li><a href='{$m->url}'>{$m->title}</a><br />{$m->summary}</li>";
    		}
    
    		$out .= "</ul>";
    
    	} else {
    		$out .= "<h2>Sorry, no results were found.</h2>";
    	}
    } else {
    	$out .= "<p>Please enter a search term in the search box (upper right corner).</p>";
    }
    
    // Note that we stored our output in $out before printing it because we wanted to execute
    // the search before including the header template. This is because the header template 
    // displays the current search query in the search box (via the $input->whitelist) and 
    // we wanted to make sure we had that setup before including the header template. 
    ?>
    
    <?php include('header.inc'); ?>
    <body>
    <div class="header clearfix">
    
    <?php include('logo.inc'); ?>
    
    <?php include('nav.inc'); ?>
    
    <h2 class="section"><? echo $page->rootParent->get("section_title_custom|title"); ?></h2>
    
    <div class="content-top"><img src="<? echo $config->urls->templates?>images/content-bg.gif" alt="content-bg" width="976" height="11" /></div>
    <div class="content clearfix">
    
    <? include('breadcrumbs.inc'); ?>
    <div class="article">
    <h1>Search results:</h1>
    <? echo $out; ?>
    </div>
    
    </div>
    	
    <? include('footer.inc'); ?>
    
    
  3. Hi,

    Does anyone know if Google have changed anything with their XML feeds. I can't get this to work at all. My code is from the simple example:

    <?php
    // get the calendar module
       $cal = $modules->get("MarkupLoadGCal");
    
       // set the feed URL: may be any google calendar XML feed URL
       $cal->load('https://www.google.com/calendar/feeds/3q20e8nef1robstuplq5knc394%40group.calendar.google.com/public/basic');
    
       // find all items for December, 2013
       $items = $cal->find('from=2013-12-1, to=2013-12-31');
    
       // render items using built-in rendering
       echo $items->render();
    
    

    The only error I get is:

    Error: Cannot break/continue 1 level (line 342 of /Users/martin/Sites/mumble/_html/site/modules/MarkupLoadGCal/MarkupLoadGCal.module)
  4. Hey NooseLadder,

    I used this on a site (non-PW) a while back. I think what it does is catch the click on a submit button and display a message.

    https://github.com/aurels/jquery.alerts

    <script type="text/javascript">
    $(document).ready( function() {
    	$("#alert_button").click( function() {
    		jAlert('Your details are being changed.<br/><br/>(If you are uploading new images this may take some time.)', 'Updating...');
    	});
    
    });
    </script>
    
    
  5. I'm really liking the ability to use font awesome icons in the page list and on a recent site I utilised the display of fields in the Page List. It got me thinking that the information itself, although useful, could be styled/displayed better.

    Would it be possible to allow the field title (and a small amount of custom styling) to be included in the Page List too? Sure, there's the potential to go overboard with something like this but if used with restraint it could be quite helpful.

    Example:

    PageList-titles.png

  6. I could see something like this being used on image-heavy sites. Someone here flagged the idea of creating an Amazon S3 uploader for files and images. I've got something like this working on an EE site I look after.

    It keeps the PW install light so if you need to move it to another host it's not such a major undertaking. Backups are simpler too.

    • Like 1
×
×
  • Create New...