Stream

Pinned by moderator

Brandon Kelly
owner

How Do I?  - 
 
Looking for help with Craft? Please consider posting your question on Craft’s new Stack Exchange site (http://craftcms.stackexchange.com). It’s by far the best place to seek help and help others!
10
Tracy McGreevy's profile photo
 
Confession: I swing by there at least once a day now to see if I missed anything.  Excellent resource, wish we could port some of the oldie but goodies out of here.  Your docs are getting better by the hour, it seems sometimes.  This is a blast...
Add a comment...

Jason Donnette

How Do I?  - 
 
I am considering switching to Craft to manage a medium sized web project. The client has a few websites that are share data (locations, blog posts & news, assets, etc) but are on different domains. Is this something I can set up in Craft using one license?
1
Jason Donnette's profile photoBrandon Kelly's profile photo
4 comments
 
Thanks!
Add a comment...

Brian Feeney

How Do I?  - 
 
I'm trying to order an entries list by a custom date (much like this: https://plus.google.com/114702861359602574436/posts/S8HwKJKp4wk). When I plug in the custom date it's doing some reordering, but not exactly by date. I can't figure out what metric it's using, but it's definitely not the date. Am I missing something?

{% for entry in craft.entries.section('songs').order('songDate') %}
1
Brandon Kelly's profile photoChristian Seelbach's profile photo
5 comments
 
Date/Time fields store their data using MySQL's DATETIME column type, and ordering by those should definitely work as expected.

Is it possible that there are entries in the results without a date set? If so that could be messing with things.
Add a comment...

Paul Terhaar

How Do I?  - 
 
Is there a way to filter a matrix by block type, or get a count of how many items there are of a certain type? Can't find a syntax example.

I created a matrix with two blocks. Basically what I want to do is this:

if (the matrix contains any blocks of typeOne) {
> create container to hold typeOne content items
> loop through the matrix and populate new container with typeOne content items
}

Same with typeTwo blocks. If there are no items of one type or the other, I don't want to create that container and have it sitting empty. 

If there is not a way to filter or get a count, I'd have to use for loops to increment vars for how many of each block type there are and then act based on those counts. Seems there should be a simpler way.

Thanks.
1
Paul Terhaar's profile photoLindsey DiLoreto's profile photo
5 comments
 
Nice!
Add a comment...

Dustin Walker

Feedback and Ideas  - 
 
This is less of a request and more of a scenario I am finding myself running into more and more when I am building out content chunks using the Matrix approach that I wanted to share. Often I want to give the editor an option of heading, a limited selection of variation on that heading, a subhead a select box that could add a class to that block a call to action that could be another entry, a file or a direct url to another site a label for the call to action. I usually like to add a class input for myself or others who could write some override CSS – though this is really not useful for an editor. If it is a class that is reused frequently I would add it to the layout type style box or add check boxes they could check to add classes.

It isn't uncommon for it to quickly look something like this on the editor side: http://note.io/TSvEQM

Sometimes the content only produces something like: http://note.io/VXCnuD other times it can produce something closer to this: http://note.io/VXDc6P (or variations on.) I'd like to keep it an additive process to a block rather than different matrix block types for these mostly similar in content goals for the chunks. That way the editor could easily attach a call to action to a block of content, add an image later or change the configuration of the layout.

It could be just a result of how I specifically approach this but just wanted to throw this out there as feedback on something that can make some entry pages feel a little overwhelming if a content editor is jumping into a preexisting page. Either way, this is already way more awesome than asking this all from a wysiwyg editor. Maybe others have similar challenges and have a better approach than I am taking. I'm sure if a lot of others are running into this you guys will be able to solve it in a brilliant way.

Thanks!
1
Christian Seelbach's profile photoDustin Walker's profile photo
5 comments
 
This last image is only a photoshop job of yours, isn't it?

Funny you also came up with that:
https://plus.google.com/101325980081569498457/posts/HRfByToYEtf

Hope this will be added to Craft natively when the field layout designer is updated. Maybe you could try to use that CP CSS plugin in the meantime.
Add a comment...

Joshua Baker

Feedback and Ideas  - 
 
Small bug in templating engine.

Expected: Twig error along the lines of “included file not found”

Actual: Timeout PHP error (30 seconds, or whatever env is set to)

For example: {% include '_includes/block/entry/' ~ block.entry.type %} where block.entry.type resolves to '' or null.
1
Joshua Baker's profile photoBrandon Kelly's profile photo
7 comments
 
Exactly. Small bug, like a mentioned, but still present in that instance. Was a little confusing without a template error.
Add a comment...
 
Does anyone have any clue why my login page is missing styling. Seems like encoding trouble, but this has been perfectly fine before. I also checked the CSS, which has alot of scrambled content... check out the screenshots.
1
Ronny-André Bendiksen's profile photoBrad Bell's profile photo
5 comments
 
Thanks +Brad Bell, your solution works :)
Add a comment...

Sam Hibberd

Show and Tell  - 
 
Simple Icon fieldtype, adding support for multiple icon fonts (currently just Font Awesome) might be useful in the meantime.
3
Add a comment...

Rob Yedlin

How Do I?  - 
 
Hello!

Ia there full page caching for Craft 2.0? I'm on a pretty fast SSD with ServInt and can't get my raw page load times below 250ms. This site: http://www.omusicawards.com/, is built with craft and loads the raw pages at 50ms. Maybe they are just using a better server?
1
Brandon Kelly's profile photoRob Yedlin's profile photo
2 comments
 
Ah, ok. Thanks for the info!
Add a comment...

About this community

 
Hi I'm new on Craft, I try to use the Craft Api without the webapp, I just need the core and  Craft.php running. When  I achieve to load the dependences of Craft.php I can't use the craft() method.
How can i do that?
1
jhonny cerezo's profile photo
3 comments
 
I tried to make what in the post says but i have still the same problem , when i drop the run() instruction i get this "Undefined property: Craft\WebApp::$request", and with the when I capture the error with try/catch sentence, the same error still happens  
Add a comment...

Trevor Polischuk

Feedback and Ideas  - 
 
Quick suggestion for Structures: We love being able to re-arrange hierarchy for all types of complex data. However, we have had multiple instances where an accidental click and drag has immediate repercussions to live elements on the website. It would be nice if it was an option (or maybe by default) that structure changes are not committed until a save button is pressed. Keep up the good work!
3
Brandon Kelly's profile photo
 
Thanks for the feedback!
Add a comment...

Joshua Baker

Feedback and Ideas  - 
 
Please can I request you move the parsing logic (i.e. numbers and raw handling) for the FeedsVariable::getFeedItems to FeedsService::getFeedItems — It’ll make using this service in our plugins DRYer.
1
Joshua Baker's profile photoBrandon Kelly's profile photo
4 comments
 
OMG. So easy. Thanks, +Brandon Kelly!
Add a comment...

John D Wells

Feedback and Ideas  - 
 
Can I get the settings of an asset transform within a template? I'd like to use the image transform's settings to generate placeholder images when an asset has not yet been selected for the field.  I can see there's a service available but it doesn't appear to be exposed to the twig parser. I've tried this:

{% set transformSettings = craft.assetTransforms.getTransformByHandle('fullWidth') %}
<img src="http://placehold.it/{{ transformSettings.width}}x{{ transformSettings.height}}">

I have no problem building a plugin if I need to, but of course I'd rather save myself the hassle if it was something you were planning on adding?
1
Brandon Kelly's profile photoJohn D Wells's profile photo
8 comments
 
OK thanks for confirming +Brandon Kelly.
Add a comment...

Brandon Kelly
owner

Tips, Tricks, and Tutorials  - 
 
+Anthony Colangelo wrote a blog post for A List Apart on using Matrix fields for longform content. Worth a read! And there's an interesting discussion underway in the comments.

http://alistapart.com/blog/post/longform-content-with-craft-matrix/
5
Anthony Colangelo's profile photoChristian Seelbach's profile photo
2 comments
 
Join the discussion, please!
Add a comment...

Dan Griffey

How Do I?  - 
 
Hi, 

I am using a normal if condition to change a select option status, but realised my field is an array.

{%- if user.educationInterests == "Biomicry" %}

So, how would the above change to check if the value is in the array?

Thanks
Dan
1
Luke Holder's profile photo
 
this would be a good question for the craft stackexchange site.

are you meaning the field is a multi-select? if so you can do


{% if entry.multiselectFieldHandle.contains('tequilla') %}
<p>Really?</p>
{% endif %}


if it is a dropdown the method you used should be correct but remember your matching on the fields selected value not the selected label. if you want to do the comparison against the label you can use

entry.dropdownFieldHandle.label
Add a comment...

Erwin Heiser

Feedback and Ideas  - 
 
Anyone has examples of Craft sites with a more complex/involved search form and result page?
Trying to gauge what's possible beyond the example form in the docs.
thanks in advance!
1
Erwin Heiser's profile photoJosh Angell's profile photo
3 comments
 
Thanks! There is still a heck of a lot of work left to do on it in my opinion...all in good time :)
Add a comment...

Jason Paul

How Do I?  - 
 
Looking to import Entries from EE1 to Craft and wanted to know if there was an XML scheme I should follow, similar to EE -> WP?
1
Brandon Kelly's profile photoJason Paul's profile photo
2 comments
 
Thanks!
Add a comment...

Ben Seitz

How Do I?  - 
 
How can I include the first category (defined in a specific field in my article) in my section’s URL Format?
1
Brandon Kelly's profile photoBen Seitz's profile photo
2 comments
 
thanks :)
Add a comment...

Alex Charlton

How Do I?  - 
 
I have problem surrounding the procedure to add a Client account.

I created a client account, but I didn't get asked for a password. If I try to set the password via the admin panel (logged in as admin), I can't reset the password because I don't know the original one. When I check the DB, the password field for that user is NULL.

I also can't run the forgot password function because the PHP mail function isn't working for me. 
1
Brad Bell's profile photoLindsey DiLoreto's profile photo
19 comments
 
Brilliant, thanks Brad!
Add a comment...
 
How do I generate a {{ siteUrl }} URL in the language currently displayed? When my website is browsed in another language, the {{ siteUrl }} redirects to the main Craft language.
1
Romain Poirier's profile photo
3 comments
 
Ok I got it. My general.php was not correctly configured: I wrote de / fr / en instead of my complete language codes de_de / fr_be / en_us.
Add a comment...