Profile

Cover photo
Dave Foy
Works at Woof
Attended St John Southworth, Preston
Lived in Preston
78 followers|31,720 views
AboutPostsPhotosVideosReviews

Stream

Dave Foy

Shared publicly  - 
 
Our new business idea finally coming to fruition!
 
As many of you know, we’ve been developing the Fossil Fuel idea for months. Now we're getting very close to launch, we've just posted a little (well, medium-sized) blog post about the story so far. Grab a brew. ;)

http://buff.ly/1nqq57C
Bit of an update on the development of the Fossil Fuel bars and brand. And some stroking of imaginary beards.
View original post
2
Add a comment...

Dave Foy

How Do I?  - 
 
I need to output some code conditionally within the anchor tag in a Structure nav, only if there are children.

Here's what I have:

{% nav page in pages %}
<li>
<a href="{{ page.getUrl() }}" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-delay="0" data-close-others="false">{{ page.title }}

<<-- IF THERE ARE CHILDREN -->   
<i class="icon-angle-down"></i>
<<-- ENDIF -->>

</a>
>> rest of structure code.....

I've tried {% ifchildren %}, I've tried various means of checking if children, and checking depth/level. Nothing seems to work. :(

Any help appreciated. Thanks.
1
Mike Pepper's profile photoDave Foy's profile photo
4 comments
 
Nifty! Works a treat. Thanks again. :)
Add a comment...

Dave Foy

How Do I?  - 
 
A client has popped a weird bit of script code into a rich text field. 

<script src ="/script.js" configuration="online*,offline,applet" showAppName="no" type="text/javascript"> </script>

This code is disappearing on save, so it doesn't appear when viewing the rich text field contents in HTML source view.

Any ideas how I can stop this code being stripped out? It's part of a flow of body copy content so not really viable to place it in its own field.

Thanks.
1
Dave Foy's profile photoBen Parizek's profile photo
3 comments
 
Ah, good to know.  Sounds like manually handling the js via some other field trigger or page specific code may be the way to go. 
Add a comment...

Dave Foy

How Do I?  - 
 
Having an issue with implementing search on the front end of a site.

I'm using the exact code from the docs:

http://buildwithcraft.com/docs/templating/search-form

If I search for a term that I know isn't contained in the site, my template outputs '0 results', not 'Your search for "iguanas doing the conga" didn’t return any results.' which is what I'd expect.

Seems like Craft thinks there are 'entries' even though there aren't.

Thanks for the help.
1
Brandon Kelly's profile photoDave Foy's profile photo
4 comments
 
Works a treat. Thanks +Brandon Kelly!
Add a comment...

Dave Foy

How Do I?  - 
 
I have a channel section with multiple entries within it. Entries are viewed in /section/{slug}

There isn't a listing page at http://example.com/section. What I'd like is for the 1st/top entry in this section to display at that URL. Basically the first page in this section of the site. At the moment, I can only view that entry at http://example.com/section/name-of-post. Obviously that's expected,. But how might I be able to view it at http://example.com/section?

If I can't do that, then there'll be no page whatsoever at http://example.com/section (the top level), which from an information architecture point of view is not too desirable.

Hope I've explained myself clearly enough.

Thanks for any help.
1
Stuart Whitehead's profile photoDave Foy's profile photo
4 comments
 
Happy to report this works fantastically well. Thanks (again)!
Add a comment...

Dave Foy

How Do I?  - 
 
I'm trying to create a linked list of all tags. I've managed to do it but can't work out how to set the sort order. I'm trying to set it by 'title desc'.

Here's what I've got (simplified):

{% for years in craft.tags.find({order: 'title desc'}) %}
   <li>{{ years.name }}</li>
{% endfor %}

I get a CDbException error page. If I remove the {order: 'title desc'} then the page loads fine, albeit with my tags in an undesired order.

Thanks.
1
Stuart Whitehead's profile photoAlexander Sundli-Härdig's profile photoBrandon Kelly's profile photoDave Foy's profile photo
4 comments
 
Thanks +Stuart Whitehead (and +Brandon Kelly) - checking the docs in the proper place would really have been helpful! Thanks v much indeed.
Add a comment...
Have him in circles
78 people
Andy Pickup's profile photo
DARRELL JACKSON's profile photo
Andrew Reid Wildman's profile photo
Gary Brown's profile photo
Debbie Fisher's profile photo
Mark Chubbock's profile photo
Matthew Crouch's profile photo
Darren Fisher's profile photo
kypa cha's profile photo

Dave Foy

How Do I?  - 
 
I'm trying and failing to get Reference Tags to work properly.

I have a plain text field in an entry. I'm trying to output the contents of that plain text field inside a Redactor field. They're actually in the same entry (if that matters).

I've put this within the Redactor field's contents:

{entry:support:supportCode}

And then this in the template:

{{ entry.textContent | parseRefs | raw }}

Unfortunately the raw reference tag code is being output on the site, rather than the contents of the field it's referencing.

Any ideas what I'm doing wrong?

Thanks.
1
Ben Parizek's profile photoBrandon Kelly's profile photoDave Foy's profile photo
11 comments
 
YES!!

Thank you, thank you, thank you, thank you. :)

I adapted it by setting the variable ('theJs') to the contents of a separate custom field (so the client can edit the javascript code if needs be).

Works a treat. And I've learnt about the replace filter now too. Handy.

Thanks once again Brandon.
Add a comment...

Dave Foy

How Do I?  - 
 
How do I paginate reverse related entries?

Here's how I'm displaying reverse related entries:

{% set relatedNews = craft.entries.section('news').relatedTo(entry) %}
{% for news in relatedNews %}
-- code here --
{% endfor %}

And here's how I'd normally paginate entries:

{% paginate craft.entries.section('news').limit(8) as entries %}
{% for entry in entries %}
-- code here --
{% endfor %}
-- paginate code here --
{% endpaginate %}

My tiny mind just can't figure out how to adapt the reverse related entries code to allow for pagination.

Thanks for any help.
1
Marion Newlevant's profile photoDave Foy's profile photo
2 comments
 
Of course! Thanks Marion, much appreciated.
Add a comment...

Dave Foy

How Do I?  - 
 
The local Craft install I'm working on has just started creating multiple log files: craft.log, craft.log.1, craft.log.2, craft.log.3, etc. I delete them then they gradually re-appear. 

I have no idea why!

Can anyone please help me figure out what's going on?

Thanks. 
1
Jacob Graf's profile photoLindsey DiLoreto's profile photoDave Foy's profile photo
5 comments
 
Ah. Worked out what's happened here. I've inadvertently lost the .gitignore file that Craft installs by default. Re-instated and now all is well.

Thanks all.
Add a comment...

Dave Foy

How Do I?  - 
 
I've created a few photo galleries in Craft, using Matrix. I have a block containing 3 fields: asset upload, alt text and caption. Client can then drag the order of blocks around, optionally disable them, etc. So far, so good.

However, I've discovered today that you can CMD-click select a whole load of images from the upload window in one go, which the client loves. Obviously this isn't possible with my current method of having 1 Matrix block per image, as each image has to be added 1 at a time, so....

In theory, could I create a gallery instead by having a single asset upload field, allowing for infinite number of uploads? I could attach custom fields to the images for captions, etc....

Sorry I know this is quite a basic question. Just wondering if I'm missing something obvious that would blow this plan out of the water?

Thanks.
1
Stuart Whitehead's profile photoDave Foy's profile photoJosh Angell's profile photo
4 comments
 
Happy to help!
Add a comment...

Dave Foy

How Do I?  - 
 
I'm using the following code to display a list of tags, linked to their own URL page.

{% for years in craft.tags.find({order: 'name desc'}) %}
<a href="{{ siteUrl }}results/{{ years.name | url_encode }}">{{ years.name }}</a>
{% endfor %}

So far so good. However, I have a set of entries, all with 'entry is enabled' UN-checked, all with the same tag, and this tag is being displayed in the tag list too, even though none of the entries with that tag are live yet. 

How do I stop tags being returned in this list that are from disabled entries?

Thanks.
1
Mike Pepper's profile photoDave Foy's profile photoStuart Whitehead's profile photo
5 comments
 
Always a pleasure.

Cool, nice tip +Mike Pepper :)
Add a comment...

Dave Foy

How Do I?  - 
 
Having a brain failure here....

I have an events section and a news section. I've created an 'entries' related field in the news section. When client adds a news story they can choose which 'event' entry the news story is about.

On the detail template for each event, I want to display any news stories that have been related to it. 

I'm currently using the standard...

{% for entry in craft.entries.find({section: 'news'}) %}

...to display all news stories on the event detail page. How would I adapt this to show only news stories related to the event being viewed?

Thanks.
1
Joshua Baker's profile photoDave Foy's profile photo
2 comments
 
Thanks Josh.
Add a comment...
People
Have him in circles
78 people
Andy Pickup's profile photo
DARRELL JACKSON's profile photo
Andrew Reid Wildman's profile photo
Gary Brown's profile photo
Debbie Fisher's profile photo
Mark Chubbock's profile photo
Matthew Crouch's profile photo
Darren Fisher's profile photo
kypa cha's profile photo
Work
Occupation
Online Marketing
Employment
  • Woof
    Partner, 2010 - present
  • Definition
    Director, 2004 - 2011
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Previously
Preston - Hull
Links
YouTube
Contributor to
Story
Tagline
Keep the cups of tea coming.
Introduction

Hi I'm Dave. I'm one half of Woof, a small online marketing consultancy based in Hull, UK. 

I cook a world-renowned chicken curry, threaten to do a lot of sporting activities (of which very little actually come off), and am a bit on the musical side. I also despise dogs with a passion (but stop short of kicking them).

Education
  • St John Southworth, Preston
    1983 - 1988
  • Newman College, Preston
    1988 - 1990
  • University of Hull
    BA Hons in something or other, 1990 - 1993
  • University of Hull
    PGCE, 1997 - 1998
Basic Information
Gender
Male
Can't rate CrossFit Hull highly enough. If you've been slogging away on your own in the gym, you really must give it a go. The quality of coaching is superb and the community incredibly friendly and supportive. You'll be pushed way beyond what you can achieve. Go on, give it a try and surprise yourself.
Public - 7 months ago
reviewed 7 months ago
4 reviews
Map
Map
Map