André Elvan
  • Member for 7 years, 7 months
  • Last seen this week
How to create a Modal with a scrollbar
3 votes

Although I agree to close this, I think Anubarak deserves an answer as to why this is not Craft related. The Garnish Modal doesn't care what you use it for, it's just a modal. So, what Daryl and Mats ...

View answer
Craft Commerce View Order PDF, Not Download
Accepted answer
3 votes

No, I don't think there's a way of having a "live" pdf open, in the same way as a webpage. But, what I usually do is just open the pdf template directly in the browser and create the HTML and CSS ...

View answer
Category conditionals
Accepted answer
3 votes

The category field returns an ElementCriteriaModel, which means you can use all the methods that you'd usually use to get a specific category on it. For instance, if the category field is named ...

View answer
Ajax Function on a search form not working in Safari & IE
Accepted answer
3 votes

Try attaching the listener on the forms submit event instead, and prevent that instead of just the click on the button. Something like this (make sure you change the selector for your form): {% if ...

View answer
conditional does not run first in a file that is included using the extends feature for twig
3 votes

The issue here is that extends isn't the same thing, neither conceptually or technically, as an include. When you extend a template with a layout template, the template is "decorated" by the layout. ...

View answer
Is there a way to manually trigger an asset transform before calling getUrl()?
3 votes

You could use my Preparse Field plugin to generate transforms when an entry (or any other element) is saved. Create a preparse field and create some twig that makes the same transforms that you do ...

View answer
Combing an If Statement with Pagination
Accepted answer
3 votes

To get the pagination to work as expected, you need to incorporate the if into your craft.entries query. There may be a more elegant solution to do this, but looking at the database, the selected ...

View answer
How to output transforms for retina images from one upload?
3 votes

I'd like to use image transforms to output the retina images but need to preserve the width and height of the original as they vary in look and dimensions. This statement kind of contradicts ...

View answer
Ordering entries by Entry Type
Accepted answer
3 votes

I don't think you can order by the types order, or get the types in your template (I might be wrong there though), but maybe you don't need to let this be completely dynamic? I guess the user won't be ...

View answer
Use Matrix Block as footer
3 votes

First you need to get the correct entry. Based on what you write, you can get it in any template by doing: {% set contactPageEntry = craft.entries.section('pages').type('contact').first() %} Then ...

View answer
I can't get Dukt Videos working in a Matrix field?
3 votes

I'm sure the documentation could be better, but this has nothing to do with Duct Video, it's simply a user error. Although a common one, when accessing things inside a matrix, assets field, or similar....

View answer
Should I use cache on data pulled from within files?
Accepted answer
3 votes

The reason the documentation says to not use it on static text, is because the cached data will be saved to the database, resulting in at least one database query (two if it needs to update the data). ...

View answer
403 when editing the Homepage
Accepted answer
3 votes

If I understand this correctly, you can't put the /craft folder above the public root, so you put both /craft and /public inside public root? That's no point, and you need a lot more .htaccess vodoo ...

View answer
How to model a multiple relation situation?
Accepted answer
3 votes

I think this is the best way to model the data, and it lends itself very well to how Craft work. I guess the only reason to go with the Matrix approach instead, would be to ease how the information ...

View answer
How to pull extra data with a user
3 votes

You can add custom fields to users the same way as you do for entries, categories, and all other elements in Craft. Create a custom field for middle name, and go to Settings > Users > Fields and add ...

View answer
Can you insert Craft variables into SCSS files and have a plugin generate CSS?
3 votes

I did the port of AutoMin to Craft, and I don't think what you want to do is possible with it. Maybe if you were somehow able to write a new file to disk, with the variables defined in it, and then ...

View answer
Image Transform path issue
Accepted answer
3 votes

The file system path has to be an absolute path from the root of your filesystem, like /Users/myuser/webserver/myproject/public/assets/images. For portability between different environments, it's a ...

View answer
Proper order of multi-environment config
3 votes

Yes, I've also found that in this case "dev.mywebsite.com" has to be after "mywebsite.com". It's a bit counter intuitive. Lately I've been using the "Foolproof Multi-Environment Config" from Craft ...

View answer
Category ID not being returned
3 votes

The craft.categories tag returns an ElementCriteriaModel, so parentCategory.title really shouldn't work. Try changing the first line of code to: {% set parentCategory = craft.categories.slug(craft....

View answer
Cannot find the target folder
3 votes

Make sure that the "Restrict uploads to a single folder?" setting in the fields settings isn't enabled. Enabling this, and not providing a valid path will give you that error I think.

View answer
Can images embedded in a Rich Text field be resized on output?
3 votes

If you create an image transform in the control panel, the client will be able to choose that transform when selecting an image (in the bottom right corner). But there's no way to get Craft to ...

View answer
Save Continue Editing
3 votes

If you install my Guano plugin, it adds an additional "Save & Continue Editing" button above the default buttons. Also, if you have several tabs, it will return to the active one when saving. It ...

View answer
Is using craft.config to access siteUrl possible?
Accepted answer
3 votes

Yes, if you set up proper multi environment configs, this isn't very hard. My config/general.php file usually look something like this: return array( '*' => array( // some general settings ...

View answer
Two-way relations
3 votes

It's not possible natively in Craft, but have look at the Many-to-many plugin from Page 8. It might not be exactly what you're after, since it assumes that you have a relationship field in one channel,...

View answer
Nested Matrix as field types
3 votes

I'll let Brandon and Brad answer regarding what's planned. :) But, couldn't you solve this by adding fields to your assets? You can make fields of whatever type and add them to the field layout of ...

View answer
DevMode Reveals Info to Everyone
3 votes

Making it only available to logged in users and/or admin, would make it impossible to debug the site as an anonymous user would see it. I'd say that's an pretty important feature which I think is ...

View answer
What are the Pros and Cons to each image transform technique?
3 votes

If you need the image transforms in Rich Text fields, you have to define them in the control panel, as Josh said. Apart from that, I feel that it's much more flexible to define them at the template ...

View answer
Pass aspect ratio as variable into imager
Accepted answer
2 votes

Your variable assignment is wrong. {% set customRatio == 1/1 %} should be {% set customRatio = 1/1 %}.

View answer
Apply imageTransform on twitter media feed
Accepted answer
2 votes

Craft's built-in transform functionality doesn't support transforming external URLs. You could use my Imager plugin to do this instead. EDIT: Based on your example, you'd use Imager something like ...

View answer
How to return data to an ajax succes callback
Accepted answer
2 votes

As Robin mentions, your controller needs to return an object of type Response, and in your case you probably want to return it with the format set to json. There's a helper method in Craft's ...

View answer