Cole Henley
  • Member for 7 years, 2 months
  • Last seen more than a week ago
Are there any plans to get Craft Docs in Dash App
7 votes

I spent a couple of hours this evening knocking together a Dash docset for Craft and have posted it up on Github at https://github.com/cole007/craftcms-dash/ Images are hotlinked from the source ...

View answer
Getting all entries from all locales
Accepted answer
5 votes

In my experience this has been problematic - instead have looped through locales to fetch entries then merged and sorted with supersort. Eg: {% set locales = craft.i18n.getSiteLocales %} {% set ...

View answer
Adding a cite tag within the blockquote tag using redactor's WYSIWYG?
Accepted answer
4 votes

You can use the Redactor Inline Styles add-on then use the following in your Redactor json config: "plugins": ["source","fullscreen","inlinestyles"], "buttonsAddAfter": "italic", "buttonsAdd":...

View answer
Local DB SQL 'CDbException' Errors on Craft 2 site
Accepted answer
3 votes

this is a MySQL/i version issue on Craft 2 sites. You'll need to add this to your database config (craft/config/db.php): 'initSQLs' => array("SET SESSION sql_mode='STRICT_TRANS_TABLES,...

View answer
Saving/assigning User Group via a plugin
3 votes

So it seems the only way to achieve this is to assign the user to the group, not the other way round (assign the group to the user). So once my user has saved I can call following: craft()->...

View answer
List entries without specific tag
Accepted answer
3 votes

You could try something like following reducing the tagged entries into IDs that you then filter against (see this thread): {% set tag = craft.tags.search('All-Stars').first() %} {% set allEntries = ...

View answer
Autologin destination
3 votes

Okay - got to the bottom of this. Was using the wrong setting. Should have been setPasswordSuccessPath not setPasswordSuccess!

View answer
Accessing custom fields from User Model
3 votes

Response via Slack from Brandon Kelly: Accessing custom field values from PHP is the same as in Twig - once you have the UserModel it's just $user->myCustomFieldHandle or $user->...

View answer
Plugin migration question
2 votes

Okay - this was a problem at our end. We had a plugin which provided a twig extension that modified Craft's own hash method which was causing issues with the migration update. Consider solved!

View answer
Element Criteria Model: filtering by empty values
2 votes

Okay, doesn't seem to be the most elegant but the only way I could achieve this was by carrying out the entries criteria query within my $fields loop. So, for example: $entries = []; foreach ($...

View answer
Triggering JavaScript from back-end event
2 votes

Thanks both for answers - realised that was probably going about things the wrong way so have tried a different approach. Using a plugin to store a timestamp of last updated article. This is saved as ...

View answer
Sprout Forms: returning error question
2 votes

Apologies - resolved. Case sensitivity issue with variable (signUp not signup)

View answer
Feedme import formatting into Refactor from JSON
1 votes

So thanks to @Dajo on the Craft Discord channel for any other folk out there experiencing similar turns out there was a config set-up for the site wasn't aware of that had set the dataDelimiter ...

View answer
Programmatically add entries to an Entry field (craft\fields\Entries)
1 votes

Although this response is specific to assets the same principles should apply to any field based on relationships (eg categories, tags, entries, etc): https://craftcms.stackexchange.com/a/28499/992

View answer
Craft Commerce: discount taxation
Accepted answer
1 votes

Got to bottom of this - is down to how the Tax Rules are set-up. Taxable Subject was set to Line Item but should have been set to Order Total.

View answer
Related To query
1 votes

Thanks for the pointers and help with this @Steve - so after some struggles have finally got this working. So needed to pass related ids or elements likes so (using ids for brevity): {% set entries =...

View answer
Special characters in `template->renderObjectTemplate` method
1 votes

The has been solved (kinda) - turns out CSS was being passed into the renderObjectTemplate method for an email template. This meant that Twig was (understandably) trying to process the { and } ...

View answer
Multiple Category Sources Field
1 votes

Got there in the end and very simply through: use Craft; use craft\fields\BaseRelationField; use craft\elements\Category; class Categories extends BaseRelationField { public static function ...

View answer
Member activation query
1 votes

Solved - bizarre one this. Was using a third-party email service via SMTP and it was manipulating the URL somehow. Switching to use a direct SMTP connection with a specific email account has resolved. ...

View answer
Venti fieldtype bug
1 votes

Have managed to resolve by updating the _convertTimes function in venti/fieldtypes/Venti_EventFieldType.php. Change (line 141): if ((is_string($value['startDate']) && $value['startDate']) || ...

View answer
500 error: uploading files (duplicate primary key)
Accepted answer
1 votes

Okay - have managed to resolve this. Needed to reset the auto increment value in the craft_elements to greater than the max(id) for the craft_assetfiles - not sure how those got out of synch but that ...

View answer
Issue accessing single entry from within category template
Accepted answer
1 votes

Okay, solved. Was an idiot and wasn't using the right tag to output the results of the query. Sorry and thanks!

View answer
Multi-environment config issue
1 votes

Sorted, thanks. The keen-eyed of you will notice that there was a space character in the server connection details. Idiot

View answer
Database Connection Error after updating from Craft 2 to 3
0 votes

Does the table prefix value in you .env file need to be in quotes? eg DB_TABLE_PREFIX="craft"

View answer
Search question: dot (period) and partials
0 votes

Many thanks for clarifying Brad - have worked out a solution at a plugin level basically querying the craft content table directly via a database query then passing the corresponding element IDs into ...

View answer
Custom fieldtype plugin
Accepted answer
0 votes

Okay, seems like there was a permission error on the folder for this plugin. This was due to pasting in a boilerplate template from pluginfactory.io To resolve updated permission of folder and ...

View answer
Showing pagination for a date range of entries
0 votes

Thanks @Michael - the difficulty is always going to be introducing some kind of pagination across dates rather than entries. Ended up hacking something together that imitates pagination. Happy to hear ...

View answer
Delete all old versions from the database
0 votes

Just to add to this, you can easily remove previous versions of files (except the current/most recent) with the following SQL query: DELETE FROM craft_entryversions WHERE id NOT IN (SELECT id FROM (...

View answer