item.info.skin.php에서 상품상세정보에 자동으로 나오는거...
본문
<div id="sit_inf_basic" style="text-align:center;">
<div id="sit_inf_open2">
<table>
<colgroup>
<col class="grid_4">
<col >
</colgroup>
<tr>
<th><?php echo $it[it_1_subj]; ?></th>
<td><?php echo $it[it_1]; ?></td>
</tr>
<tr>
<th><?php echo $it[it_2_subj]; ?></th>
<td><?php echo $it[it_2]; ?></td>
</tr>
<tr>
<th><?php echo $it[it_3_subj]; ?></th>
<td><?php echo $it[it_3]; ?></td>
</tr>
<tr>
<th><?php echo $it[it_4_subj]; ?></th>
<td><?php echo $it[it_4]; ?></td>
</tr>
<tr>
<th><?php echo $it[it_5_subj]; ?></th>
<td><?php echo $it[it_5]; ?></td>
</tr>
<? if($it[it_6]) { ?>
<tr>
<th><?php echo $it[it_6_subj]; ?></th>
<td><?php echo $it[it_6]; ?></td>
</tr>
<? } ?>
<? if($it_7) { ?>
<tr>
<th><?php echo $it[it_7_subj]; ?></th>
<td><?php echo $it[it_7]; ?></td>
</tr>
<? } ?>
</table>
</div>
</div>
이부분이 내용수정이랑 관계없이 그냥 나오는거 같은데 특정아이템에서만 없애게 하려고 하니깐 내용수정 부분이랑 관계가 없어서 그냥 if문써서 하는 방법 밖에 없나요?
답변 1
모든 코드에서 IF문은 매우 중요하고 유용한 로직이고 핵심이죠
다른방법은 include를 item별로 다르게 하는방법일텐데
앞의 첨자를 다르게 등록해서
특정 첨자가 있는경우
첨자를 붙여서 include를 다른것이 되게 하거나 안되게 하는방법이 가능하겠네요
그게 어렵다면
if문으로 하는게 가장 효과적입니다.
특정 item에 특정한필드의 값을 다르게 판단조건으로 활용할수도있겠네요