markdown Fishpig / Magento内的自定义字段

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown Fishpig / Magento内的自定义字段相关的知识,希望对你有一定的参考价值。

```php
$post = $this->getPost();
$postContent = $post->getPostContent();

if( $post->getMetaValue('fields') ) :
	$_fields		= $post->getMetaValue('fields');
	$postTitle		= $post->getData('post_title');
	$_helper		= $this->helper('catalog/output');
	$_filterHelper	= $this->helper('wordpress/filter');


	// If "hide title" in the admin is selected, then hide it!
	if( !$post->getMetaValue('hide_title') ) :
		echo '<h1 class="landingpage__title">'.$postTitle.'</h1>';
	endif;


	// Get the brand colour
	$brandColour = $post->getMetaValue('primary_brand_colour');
	
	
	// Output the standard page content
	echo $postContent;


	// Loop through each of the repeater fields and output accordingly
	foreach ($_fields as $_field) :
		switch ($_field['type']) : 


			/**
			 * VIDEO
			 * Just a big 'ol video
			 */
			case 'video':
				$videoSrc = $_field['video'];

				echo	'<div class="landingpage__block">'.
							'<div class=" landingpage__video embed-container">'.
								$videoSrc.
							'</div>'.
						'</div>';
				break;


			/**
			 * INTRO
			 * Title with yellow line through it, and a brief intro
			 */
			case 'intro':
				$title = $_field['intro_title'];
				$intro = $_field['intro'];

				if( $brandColour ) :
					echo '<style>.landingpage__intro h2:before{ background: '.$brandColour.' }</style>';
				endif;

				echo	'<div class="landingpage__block">'.
							'<div class="landingpage__intro">'.
								'<h2><span>'.$title.'</span></h2>'.
								'<div class="landingpage__intro-content">'.$intro.'</div>'.
							'</div>'.
						'</div>';
				break;


		endswitch;
	endforeach;
endif;
```

以上是关于markdown Fishpig / Magento内的自定义字段的主要内容,如果未能解决你的问题,请参考以下文章

wordpress fishpig magento 安装 - getPostListHtml()

Fishpig 自动登录在 Magento 1.9 中不起作用

Magent实现Memcached集群

部署Memcached+magent+keepalived高可用集群

Memcached+keepalived+magent实现主从复制和高可用

magent编译安装及常见错误