Joomla 我的博客模板

发布于 2024-10-13 03:28:21 字数 3653 浏览 4 评论 0 原文

我想在 myBlog 组件中编辑我当前的模板,我相信该模板位于此处:

\components\com_myblog\templates\bluestyle 

我询问的主要原因是因为我不知道在哪里修复我正在维护的网站中的错位。

但是,如果您尝试浏览网站顶部的其他选项卡,它们根本没有问题,只是碰巧 myBlog 组件除了默认的 Joomla 模板之外还有自己的模板。

我相信问题出在我的 Joomla 文件路径中的某个地方:

C:\xampp\htdocs\lopez-link\components\com_myblog\templates\bluesky

显然,我选择的模板在该文件夹中名为“bluesky”,它有 3 个 html 文件(bloginfo.tmpl.htmlentry.txt)。 tmpl.htmlindex.tmpl.html)和 CSS 文件 (template_style)。我在下面包含了我的index.tmpl.html 代码。

index.tmpl.html

<?php
if ($entry and is_array($entry) and count($entry) != 0)
{
    foreach ($entry as $e)
    {
        $date = strtotime($e['created']);
        $month_day = strftime("%b ", $date) . strftime("%d", $date);
        $year = strftime("%Y", $date);
        $month_day = i8n_date($month_day);
    ?>
 <div class="entryContent">
<div class="entry">
    <table class="entryTitle">
        <tr>
            <td class="my-dateCell">
                <div class="dateContainer">     
                    <div class="date">
                        <div class="month"><span><?php echo $month_day; ?></span></div>
                        <div class="year"><span><?php echo $year; ?></span></div>
                    </div>
                </div>
            </td>
            <td class="my-titleCell">
                <div class="entry-title">
                    <h3><a href="<?php echo $e['permalink']; ?>"><?php echo $e['title']; ?></a></h3>
                    <p>_MB_POSTED_BY <a href="<?php echo $e['authorLink']; ?>"><?php echo $e['author']; ?></a> in <?php echo $e['categories']; ?></p>
                </div>
            </td>           
            <?php if(!empty($e['avatar'])){ ?>
            <td class="my-avatarCell">
                <div class="userAvatar">
                <?php echo $e['avatar']; ?>
                </div>
            </td>
            <?php } ?>
        </tr>
    </table>
    <?php
        if ($e['beforeContent'])
        { ?>
        <div class="onBeforePrepareContent">
            <?php echo $e['beforeContent'];?>
        </div>
        <?php
        }
        ?>
    <div class="entry-body"> 
        <?php echo $e['text']; ?>
        <div class="clear"></div> 
    </div>
    <?php if ($e['afterContent'])
        { ?>
        <div class="onAfterPrepareContent">
            <?php echo $e['afterContent'];?>
        </div>
        <?php
        }
        ?>
    <div class="entry-footer">
        <?php
            if ($e['comments']!="") // if comments enabled

                echo '<div class="entry-comment"><a href="'.$e['permalink'].'#comments">'.$e['comments'] .'</a>';
            else
                echo '<div>';
            if ($e['comments']!="" and $e['readmore']=="1")
                 echo ' | ';
        ?>
        <?php  // IF NEED READMORE
        if ($e['readmore']=="1")
        { ?>
        <a href="<?php echo $e['permalink']; ?><?php echo $showAnchor; ?>">_MB_READ_MORE...</a>
        <?php } ?>
        </div> 
    </div>
</div>
 <?php
}
   }
 ?>

我该如何解决这个问题?

I would like to edit my current template in myBlog component which I believe is located here:

\components\com_myblog\templates\bluestyle 

My main reason for asking is because I don't know where to fix a misalignment in the website I am maintaining.

But if you would try to browse the other tabs on top of the site, they have no problems at all, it's just so happened that myBlog component has its own template aside from the default Joomla template.

I believe the problem is somewhere in this path of my Joomla file:

C:\xampp\htdocs\lopez-link\components\com_myblog\templates\bluesky

Obviously my chosen template is named "bluesky" inside this folder it has 3 html files (bloginfo.tmpl.html, entry.tmpl.html and index.tmpl.html) and a CSS file (template_style). I included below my index.tmpl.html code.

index.tmpl.html

<?php
if ($entry and is_array($entry) and count($entry) != 0)
{
    foreach ($entry as $e)
    {
        $date = strtotime($e['created']);
        $month_day = strftime("%b ", $date) . strftime("%d", $date);
        $year = strftime("%Y", $date);
        $month_day = i8n_date($month_day);
    ?>
 <div class="entryContent">
<div class="entry">
    <table class="entryTitle">
        <tr>
            <td class="my-dateCell">
                <div class="dateContainer">     
                    <div class="date">
                        <div class="month"><span><?php echo $month_day; ?></span></div>
                        <div class="year"><span><?php echo $year; ?></span></div>
                    </div>
                </div>
            </td>
            <td class="my-titleCell">
                <div class="entry-title">
                    <h3><a href="<?php echo $e['permalink']; ?>"><?php echo $e['title']; ?></a></h3>
                    <p>_MB_POSTED_BY <a href="<?php echo $e['authorLink']; ?>"><?php echo $e['author']; ?></a> in <?php echo $e['categories']; ?></p>
                </div>
            </td>           
            <?php if(!empty($e['avatar'])){ ?>
            <td class="my-avatarCell">
                <div class="userAvatar">
                <?php echo $e['avatar']; ?>
                </div>
            </td>
            <?php } ?>
        </tr>
    </table>
    <?php
        if ($e['beforeContent'])
        { ?>
        <div class="onBeforePrepareContent">
            <?php echo $e['beforeContent'];?>
        </div>
        <?php
        }
        ?>
    <div class="entry-body"> 
        <?php echo $e['text']; ?>
        <div class="clear"></div> 
    </div>
    <?php if ($e['afterContent'])
        { ?>
        <div class="onAfterPrepareContent">
            <?php echo $e['afterContent'];?>
        </div>
        <?php
        }
        ?>
    <div class="entry-footer">
        <?php
            if ($e['comments']!="") // if comments enabled

                echo '<div class="entry-comment"><a href="'.$e['permalink'].'#comments">'.$e['comments'] .'</a>';
            else
                echo '<div>';
            if ($e['comments']!="" and $e['readmore']=="1")
                 echo ' | ';
        ?>
        <?php  // IF NEED READMORE
        if ($e['readmore']=="1")
        { ?>
        <a href="<?php echo $e['permalink']; ?><?php echo $showAnchor; ?>">_MB_READ_MORE...</a>
        <?php } ?>
        </div> 
    </div>
</div>
 <?php
}
   }
 ?>

How can I fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暗喜 2024-10-20 03:28:21

编辑:
愿这对你有帮助。
找到代码

if ($e['readmore']=="1")
{ ?>
    <a href="<?php echo $e['permalink']; ?><?php echo $showAnchor; ?>">_MB_READ_MORE...</a>
        <?php } 

并将其替换为

if ($e['readmore']=="1")
        { ?>
        <a href="<?php echo $e['permalink']; ?><?php echo $showAnchor; ?>">_MB_READ_MORE...</a>
        <?php } 
        echo '</div>';

EDITED :
May this help you.
find the code

if ($e['readmore']=="1")
{ ?>
    <a href="<?php echo $e['permalink']; ?><?php echo $showAnchor; ?>">_MB_READ_MORE...</a>
        <?php } 

and replace it with

if ($e['readmore']=="1")
        { ?>
        <a href="<?php echo $e['permalink']; ?><?php echo $showAnchor; ?>">_MB_READ_MORE...</a>
        <?php } 
        echo '</div>';
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文