How to Extract File Manager Data

More
2 years 6 months ago - 2 years 6 months ago #82221 by iamrobert
We wanted to custom code a download link for our accordion block:



Our custom output came from here:



You should be able to alter row[2] to your field:
Code:
       if ( $row[ 2 ] != '' ) {         $d = new DOMDocument();         $d->loadHTML( $row[ 2 ] );         $x = new DOMXpath( $d );         $file_title = $x->evaluate( '//span[contains(@class, "fcfile_title")]' );         $file_url = $x->evaluate( '//a[contains(@class, "fcfile_downloadFile")]' );         $investor_download = '';         if ( $file_title->length > 0 ) {           $file_title = $file_title->item( 0 )->nodeValue;           $file_url = $file_url->item( 0 )->getAttribute( 'href' );           $investor_download .= '<div class="grid gap-x-xl align-bottom justify-between border-top-dark pt-ph mt-p">';           $investor_download .= '<div class="col-content"><p>' . $file_title . '</p></div>';           $investor_download .= '<div class="col-content"><p><a href="' . $file_url . '" class=" button icon-left fcfile_downloadFile no-barba" title="' . JText::_( 'DOWNLOAD_TEXT' ) . '" target="_blank"><i class="icon icon-download"></i>' . JText::_( 'DOWNLOAD_LINK' ) . '</a></p></div>';           $investor_download .= '</div>';         }       }


Here's the full PHP file that I call in my item.php:

item-accordion.php
Last edit: 2 years 6 months ago by iamrobert.

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

More
2 years 6 months ago #82224 by micker
thanks for share !!

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.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.577 seconds
Save
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