[Solved] Total of files in Item (subcategory view)

More
10 years 8 months ago - 10 years 8 months ago #49844 by tevez15
Hi,

I have one question, is possible know how many Files (field file) one article have in subcategory view? :P
Attachments:
Last edit: 10 years 8 months ago by tevez15.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #49847 by micker
without code .. not

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #49854 by ggppdk
Hello

inside your template:

If you have the field in a template position
Code:
<?php echo count($item->fields['fieldname']->filedata); ?>

or if you don't have the field in a template position:
Code:
<?php echo count($item->fields['fieldname']->values); ?>


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #49884 by tevez15
hello :)

The file what I talking about is category_subcategories_html5.php.. :|

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #49885 by ggppdk
Hello

just do a loop in the items and calculate a total
Code:
$total_files = 0; foreach($this->items as $item) { $total_files += count($item->fields['fieldname']->values); } echo "Total files: ". $total_files. "<br/>";


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #49932 by tevez15
I used the code and nothing happens.

Im using version 2.2.0 r1995 of Flexicontent.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.341 seconds
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save