Skip to main content

Questions tagged [format]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
232 views

How to Auto-generate a Title based on a multiple entries titles? (using a Entries field type)

I have two sections (both Channel type): Releases Movies Releases have one Entries field type, the source is Movies So, I want Auto-generate a Release title from Movies, like this: Titanic, Avatar, ...
user15280052's user avatar
1 vote
1 answer
51 views

Field formatting

I'm looking for a way to restrict how a field gets formatted. I have a channel for a podcast that should always be in the format of hh:mm:ss - despite the instructions making this clear, editors tend ...
Steven Grant's user avatar
  • 1,855
3 votes
2 answers
2k views

Entry Post Date Format time since - X days ago

Is there anyway to get my date formats looking like Facebook? I'd like to get my articles to have this as a date format: "5 min ago", "yesterday", "3 days ago", "4 months ago" and then once it reaches ...
mateostabio's user avatar
1 vote
1 answer
824 views

Element API: Remove additional set of square brackets from JSON-String

We're currently having an Android-App access some of the entries of our Craft-based website. We are currently still using a self built API, and for easier creation of new API-Calls we are trying to ...
justussimon91's user avatar
1 vote
1 answer
665 views

Is it possible to include category slugs in the entry URL format?

Is it possible to include category or tag slug in the entry URL format? Would you please let me know the tags that make it, if possible?
Hiromi Ando's user avatar
4 votes
2 answers
962 views

Multiple URL's for news entry?

For news entries I want both URL's www.example.com/news/678 (where 678 stands for the entry id) and www.example.com/news/some-slug to load the same entry. www.example.com/news/some-slug works fine ...
Mark Olijslagers's user avatar
6 votes
3 answers
6k views

How do I add class to redactor format list?

I understand that to add a "note" class to the redactor text editor drop down, I need to use formattingAdd. But each iteration I've tried does not work. The example is: https://imperavi.com/redactor/...
Jayna's user avatar
  • 75
0 votes
1 answer
126 views

Formatting Headers, Quotes, Titles

I've just updated to 2.5 and am now not able to see or find the text styling option in a text box. We use the formatting option across our site for different headers, quotes, etc. Am I missing ...
Jordan Cox's user avatar
5 votes
4 answers
3k views

Price Formatting

I'm outputting prices in a channel with a little formatting like so: £{{ entry.priceFrom|number_format(2,'.',',') }} Gives me £1,000.00 or £99.99 etc... However client isn't a fan of the ...
Ian Ebden's user avatar
  • 894
0 votes
2 answers
100 views

My Entry URL Format needs are too long for the field restrictions

I'm trying to set the URL of my product entry's to be dynamically created based on 3 category fields and 2 number fields. The category fields are required, but I need to add some logic for the number ...
Chandra's user avatar
  • 42
2 votes
1 answer
422 views

How do I use Plain Text Field in URL Format?

I'm creating an events system & I want to include the venue in the url of the event along with the event name. For now the venue name is just stored using a plain text field. Is there an easy ...
Seán O'Grady's user avatar
3 votes
1 answer
434 views

How to translate de postdate format for a multilanguage site

I have a site with 2 languages: Nl and En Everything translates to Dutch but only the date stays in English... I use this to get my news items: {% for entry in craft.entries.section('news').limit(6)....
Lisa Van Daele's user avatar
7 votes
3 answers
4k views

Is there a way to format the Asset Size variable to Mb, Kb, etc.?

I'm trying to display the file size of a file uploaded in Assets. I can get it to display the number of bytes in the file. https://craftcms.com/docs/templating/craft.assets#size Is there a way to ...
Dave Joyce's user avatar
1 vote
1 answer
1k views

Twig: Convert time format

I have a video Object with a duration property formatted in SCORM 2004 time format. Like so: PT51M55S. How do i convert this into a human readable time format like: 51:55? date() does not seem to work ...
Marcus Scheller's user avatar
7 votes
1 answer
4k views

URL Format of a nested structure with 3 or more layers

I have a nested Structure with 3 layers like so: Home Services Service A Sub Service A Sub Service B Service B About Us Contact Now I would like the nesting to be reflected in the URL like so: ...
Andreas's user avatar
  • 491
10 votes
1 answer
952 views

Is there a way to find out if images (assets) are landscape or portrait?

In a current project we will list entries in a masonry-style grid view where the entry’s respective cover image should be styled differently based on their image format. Landscape vs. portrait and -- ...
Marcus Scheller's user avatar
11 votes
2 answers
1k views

How can I create a visually weighted tag cloud?

I kind of want a tag archive page where it doesn't just list all the tags and links to entries based on that tag, but where the sizes of the actual tag link vary based on frequency of use. Any idea ...
lealea's user avatar
  • 605
10 votes
1 answer
229 views

How can I output a timeframe in fully written notation nicely?

Let's say you have two dates and want to output the timeframe in fully written "day month year - day month year" notation, but want to leave out the month and year parts of the start date if ...
carlcs's user avatar
  • 36.3k