Page 1 of 1

[Feature request] Use Read more in Details button

Posted: 18 Feb 2011, 11:36
by pweb
Hi,
I would like to have short intro text in Details button in category view
and full text in file view.

I think that Joomla Read More feature will be useful for this.

Re: [Feature request] Use Read more in Details button

Posted: 19 Feb 2011, 01:21
by Jan
Hi, added into feature request list.

Jan

Re: [Feature request] Use Read more in Details button

Posted: 19 Feb 2011, 12:34
by pweb
v1.3.7

file: components\com_phocadownload\models\file.php
method: getDocument

Code: Select all

	function getDocument( $fileId, $params, $limitstartUrl) {
		...
		
		if (empty($this->_document)) {	
			...
			
			// remove readmore tag
			$pattern = '#<hr\s+id=("|\')system-readmore("|\')\s*\/*>#i';
			$this->_document[0]->description	= preg_replace($pattern, ' ', $this->_document[0]->description);
			
		}
		return $this->_document;
	}
file: components\com_phocadownload\models\category.php
method: getDocumentList

Code: Select all

	function getDocumentList($categoryId, $params) {
		...
		
		if (empty($this->_document)) {	
			...
			
			// search for introtext
			$pattern = '#(.+)\s*<hr\s+id=("|\')system-readmore("|\')\s*\/*>#i';
			for ($i = 0; $i < count($this->_document); $i++) {
				$tagPos	= preg_match($pattern, $this->_document[$i]->description, $matches);
				if ($tagPos > 0) {
					$this->_document[$i]->description = $matches[1];
				}
			}
		}
		return $this->_document;
	}

Re: [Feature request] Use Read more in Details button

Posted: 24 Feb 2011, 23:51
by Jan
Hi, thank you for this info.

Jan