Tom Bauer
  • Member for 6 years, 9 months
  • Last seen more than a week ago
  • Zurich, Switzerland
Move unused Assets to a specific Folder
5 votes

I found the solution: The moveFiles function provide the function to move a file: /** * Move or rename files. * * @param $fileIds * @param $folderId * @param string $filename If this is ...

View answer
How to list out entry types in a section
Accepted answer
5 votes

Take a look at the sections documentation: https://craftcms.com/docs/templating/craft.sections The following code lists all entrytypes of all sections. {% set sections = craft.sections....

View answer
Are there any advantages of updating from PHP 5.4.40 to 5.6?
Accepted answer
5 votes

Short yes! You can find a detailed Benchmark on http://www.lornajane.net/posts/2014/php-5-6-benchmarks. If possible i would try to update from PHP 5.4.40 direct to PHP 7. The performance from PHP 5.4 ...

View answer
How to improve performance of this nested entries/array template?
4 votes

Have you considered to cache the whole output? https://craftcms.com/docs/templating/cache

View answer
How to pull out all user data in a template?
Accepted answer
4 votes

If i understand your question correct, you like to output the user data. I don't think that you need the getContent() function. But it's important, that you use the first() function. Here is your code:...

View answer
Is it possible to loop through locales?
Accepted answer
4 votes

You can try to use the following code to loop through the locales: {% set locales = craft.i18n.getSiteLocaleIds()%} {% for locale in locales %} {% set localeEntry = craft.entries.id(entry.id)....

View answer
How do I group matrix blocks into batches of 4?
Accepted answer
3 votes

You could use your own variable to count the matrix blocks in your loop. The code could look like this: {% set rows = 0 %} <div class="row"> {% for event in events %} {# loop through all ...

View answer
Parse html on first and last occurrence of a matrix block type in a series of that same block type
Accepted answer
3 votes

You need to define the block previous/next variables outside of your for loop. Also you should check for the last element in the loop. You can find a great working example on the happy lager demo ...

View answer
Image transformation of tif image does not work
3 votes

I found the way to create thumbnails of tif files. You have to change the function isImageManipulatable in the file /craft/app/helpers/ImageHelper.php: public static function isImageManipulatable($...

View answer
Problem with @font-face url 500 server error craft style
3 votes

Your css and your fonts should be in the public section of the craft website. So put your css in "root/public/assets/css" and "root/public/assets/fonts/bootstrap". Than remove the {{ siteurl }} twig ...

View answer
Manual crop in Image Transforms
Accepted answer
2 votes

I don't know a plugin like this for Craft. But this solution does a similar thing. Maybee it works for you: Let clients set crop position for images. Otherwise you could also take a look on the ...

View answer
How to structurize a multi-project documentation site?
Accepted answer
2 votes

Welcome to the Craft community. You try to create a new section for each project - right? In my opinion this is only necessary if you need different view and edit rights on each project. If you'r ...

View answer
Save the form if not complete and come back another time to complete the form
Accepted answer
2 votes

The FormBuilder plugin has no option to edit a submitted form. I think the best way is to use a channel in Craft CMS and write your own form. You can find the documentation on how to create/edit ...

View answer
How can I localize cpEditUrl?
Accepted answer
2 votes

The following code should work for you: {% if entry.isEditable() %} <a href="{{ entry.cpEditUrl }}/{{ craft.locale }}">Edit entry</a> {% endif %}

View answer
Is caching the layout wrapper template a viable option?
Accepted answer
2 votes

In my opinion it's a good, easy and fast way to caching content. We use similar solutions on different Websites and it works perfect for us. Maybe you should do a more specific flagging to avoid ...

View answer
Best way to access getPrev and getNext asset fields
Accepted answer
2 votes

If you need only one image, you can use the first() function instead of a for loop. I recommend to check always if a image or entry exists, befor use it. Otherwise you risk to get an error. During ...

View answer
How to make combination of two field values unique?
2 votes

If I understood you correctly, you have two sections: events registrations Is the user logged in? If yes, you can save the user id in your registration entry. In your events template you can check ...

View answer
Problem with getHeadHtml(), getFootHtml() and caching
2 votes

Regarding Problem 1 The Twig function {{ getHeadHtml() }} does only work with JS/CSS that are included before this tag. I had the same problem... you can find the answer/explanation of Brandon Kelly ...

View answer
How can I get the correct label of a dropdown that has matching values?
Accepted answer
2 votes

Craft saves only the option value of a field, not the option description. After saving and editing again, it loops trough all the option values and compare it with the saved value. If it matchs it ...

View answer
Order Sprout Forms by field handle returns an error
2 votes

It seams, that the columns for the form values are not part of the sql, that's why it never will work like this. Maybe it works in upcomming versions of the Sprout Forms plugin. As a workaround you ...

View answer
Recommended hosting company for a Craft site?
1 votes

For websites in Switzerland i recommend to use Cyon (https://www.cyon.ch/). It runs on LiteSpeed Webserver and offers a easy to integrate fullpage cache solution comparable to Varnish cache without ...

View answer
How should a multi-stage editorial process be implemented in Craft?
1 votes

Have you already seen the workflow plugin? Maybe it could give you some inputs for your further development: https://github.com/engram-design/Workflow.

View answer
Possible to share assets, templates and plugins across two domains but not all content?
1 votes

You could make use of symbolic links. This works if your sites are: on the same system your system is running on a Linux server environment you have console access (ex. SSH) With symbolic links ...

View answer
Session related question - opening browser with multiple tabs
1 votes

Per default, there is no way to have different sessions in the same browser window. The sessions are always shared trough all tabs. If two different Sessions are enough, you could use a privat/...

View answer
How can I efficiently show the number of total results per channel when retrieving search results?
1 votes

I would try one of the following solutions: Using Ajax to display the search results and the filter Use ajax to display your search results. After loading the search results, you'r using a second ...

View answer
Can I output the Placeholder Text of a plain text matrix block?
Accepted answer
1 votes

The "docs" means only on the admin form. For outputing a default text on empty fields in frontend you can use the following code in you template: {{block.FIELDNAME | default("Placeholdertext") }}

View answer
GUI Crop image field - Plugin request
1 votes

Have you seen this solution: http://craftcookbook.net/recipes/120? Vote here for better image cropping in Craft: http://feedback.craftcms.com/forums/285221-feature-requests/suggestions/7302748-...

View answer
Restricted access to assets in Redactor
1 votes

I found a solution to change the allowed asset sources in redactor. If you like to change the allowed asset sources global without making any difference between users/groups, than you can use the ...

View answer