doulaozhang0238 2016-08-10 13:31
浏览 83

silverstripe模板中的样式列表 - “[警告] ViewableData :: getField()缺少参数1”

at first I would like to say hello to all the users of this page, I've been using it for some time while looking for help in web developement, but it's time to ask a question.

I have to modify two lists on a silverstripe template to look similar to each other - here's the one that is the "source":

<% if not $IsThanks %>
                <% if $IsSequentialSearch %>
                    <section class="panel vacancy columns jobalertform" style="background: #fff;">
                        <h1 class="searchfilter"><%t Site.JobAlert 'Job Alert' %></h1>
                        <% include JobAlertForm %>
                    </section>
                <% else_if $IsSearch %>
                    <section id="JobAlertFormModal" class="reveal-modal medium row" style="background: #fff;top:200px!important" data-reveal aria-hidden="true" role="dialog">
                        <h1 class="searchfilter"><%t Site.JobAlert 'Job Alert' %></h1>
                        <% include JobAlertForm %>
                        <a class="close-reveal-modal" aria-label="Close">&#215;</a>
                    </section>
                <% end_if %>
            <% end_if %>

and here's the one that I have to modify to look similar to the previous one:

<ul>
                    <% loop $Jobs %>
                        <% if $IsInternal %>
                            <section class="panel vacancy columns jobalertform" style="background: #fff;">
                                <a href="$SireJobPage.Link('viewvacancy')/$Link/?m=$ConsultantID" target="_blank" title="$Title"><h1 class="searchfilter">
                                    <% include JobAlertForm %>

                                </h1></a>
                            </section>
                        <% else %>
                            <section class="panel vacancy columns jobalertform" style="background: #fff;">
                                <a href="$JobAdPage.Link('viewvacancy')/$Link/?m=$ConsultantID" target="_blank" title="$Title"><h1 class="searchfilter">
                                    <% include JobAlertForm %>

                                </h1></a>
                            </section>
                        <% end_if %>
                    <% end_loop %>
                </ul>

The first one is responsible for job search results, and the second one is a list of jobs related to specific recruiter. When I'm pasting <% include JobAlertForm %>I'm getting error [Warning] Missing argument 1 for ViewableData::getField(), called in /var/www/sites/sire-search.com/htdocs/framework/view/ViewableData.php on line 108 and defined. Where's my mistake?

JobAlertForm.ss

<% with $JobAlertForm %>
    <% if $IncludeFormTag %>
        <form $AttributesHTML data-abide>
    <% end_if %>
    <% if $Message %>
            <div id="{$FormName}_error" class="alert-box<% if $MessageType == "bad" %> alert<% end_if %>">$Message<a href="" class="close">&times;</a></div>
    <% else %>
            <div id="{$FormName}_error" class="alert-box secondary" style="display: none;"></div>
    <% end_if %>

        <div class="row">
            <div class="columns small-12 medium-8">
                <% loop $Fields %>
                    $FieldHolder
                <% end_loop %>
            </div>
            <div class="columns small-12 medium-4">
                <% loop $Actions %>
                    $Field
                <% end_loop %>
                <p>
                    <%t Site.IfContinueAgreeWithOur 'If you continue, you are agreeing with our' %>
                    <a id="TOSLink" href="$Top.PrivacyPolicyPage.Link" target="_blank"><%t Site.TermsAndConditions 'Terms & Conditions' %></a>
                    .</p>
            </div>
        </div>

    <% if $IncludeFormTag %>
        </form>
    <% end_if %>
<% end_with %>
  • 写回答

1条回答 默认 最新

  • douli6605 2016-08-19 12:19
    关注

    ok, I solved this, the code should look like this (with some additional modifications for other purposes):

    <section class="panel vacancy columns" data-link="{$Up.JobAdPage.Link('viewvacancy')}/$Link{$Up.SearchFiltersAsQueryString}&pos={$Pos}" data-target="_blank">
       <h2><a href="$SireJobPage.Link('viewvacancy')/$Link/?m=$ConsultantID" target="_blank" title="$Title">$Title</a></h2>
       <p class="img">
         <a class="button radius tiny right" href="{$Up.JobAdPage.Link('viewvacancy')}/$Link{$Up.SearchFiltersAsQueryString}&pos={$Pos}" target="_blank" title="<%t Site.ApplyNow 'Apply Now' %>">
              <%t Site.ApplyNow 'Apply Now' %>
           </a>
           <img class="profile" alt="$Consultant.Title" title="$Consultant.Title" src="$Consultant.ProfilePicture.URL" />
       </p>
       <dl>
            <dt><%t Site.Location 'Location' %></dt><dd><% if $JobAdRegion.Title %>$JobAdRegion.Title / <% end_if %>$JobAdCountry.Title</dd>
            <dt><%t Site.Specialisation 'Specialisation' %></dt><dd>$JobAdSpecialisation.Title</dd>
            <dt><%t Site.Sector 'Sector' %></dt><dd>$JobAdSector.Title</dd>
       </dl>
       <p>
               $Summary
       </p>
    </section>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料