Let's take a look at the code of the default column call:
Copy the Code code as follows:
{pc:content action= "lists" catid= "$catid" num= "order=" "id DESC" page= "$page"}
<ul class= "list lh24 F14" >
{Loop $data $r}
<li><span class= "RT" >{date (' y-m-d h:i:s ', $r [inputtime])}</span> <a href= "{$r [url]}" target= "_ Blank "{Title_style ($r [style])}>{$r [title]}</a></li>
{if $n%5==0}<li class= "Bk20 hr" ></li>{/if}
{/loop}
</ul>
<div id= "pages" class= "text-c" >{$pages}</div>
{/PC}
As you can see, this is called the article title, URL, publish time, list paging, then how to call the article content?
In this case, is it possible to use moreinfo= "1" and then call {$r [content]} inside loop? The answer is no, because look at the database structure to know: the content and title are not in a table side, so cannot be adjusted out.
Look at the following calling code method:
Copy the Code code as follows:
{pc:content action= "lists" catid= "$catid" num= "order=" "id DESC" page= "$page" moreinfo= "1"}
<ul class= "list lh24 F14" >
{Loop $data $r}
<li><span class= "RT" >{date (' y-m-d h:i:s ', $r [inputtime])}</span> <a href= "{$r [url]}" target= "_ Blank "{Title_style ($r [style])}>{$r [title]}</a>
<?php $id = $r [' id '];
$sql = "Select ' content ' from ' cmsyou_news_data ' WHERE ' id ' = ' $id ' LIMIT 0, 1";
$query = mysql_query ($sql);
while ($row =mysql_fetch_array ($query)) {
echo $row [content];
}
?>
</li>
{if $n%5==0}<li class= "Bk20 hr" ></li>{/if}
{/loop}
</ul>
<div id= "pages" class= "text-c" >{$pages}</div>
{/PC}
Where the following code calls the corresponding content:
Copy the Code code as follows:
<?php $id = $r [' id '];
$sql = "Select ' content ' from ' cmsyou_news_data ' WHERE ' id ' = ' $id ' LIMIT 0, 1";
$query = mysql_query ($sql);
while ($row =mysql_fetch_array ($query)) {
echo $row [content];
}
?>
is to invoke the corresponding ID content of the specified data table directly with SELECT. We do not put extrapolate, do more to try! There are different ways to welcome the message to discuss!
PHPCMS v9 Column list call each article content Method 1