We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [format]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
33 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 ...
3
votes
2answers
286 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 ...
1
vote
1answer
641 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 ...
1
vote
1answer
323 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?
4
votes
2answers
495 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 ...
5
votes
2answers
4k 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/...
0
votes
1answer
75 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 ...
5
votes
4answers
2k 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 ...
0
votes
2answers
89 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 ...
2
votes
1answer
311 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 ...
3
votes
1answer
399 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)....
3
votes
2answers
2k 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 ...
1
vote
1answer
984 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 ...
3
votes
1answer
3k 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: ...
9
votes
1answer
538 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 -- ...
11
votes
2answers
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 ...
10
votes
1answer
218 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 ...