Javascript mit if-Abfrage Bereich ausblenden

  • Hallo wiedereinmal,

    Ich möcht, dass wenn die url so und so ist, ein htmlbereich gezeigt wird, oder eben nicht:

    das hab ich bis jetzt:

    so geht das nicht, wie muss ich das machen?

    Gruss

  • So gehts auch net:

  • schon hast nen konflickt ;)
    die doppelten Anführungstriche.


  • Hm geht net, mach ichs halt so:


    Code
    if( location.pathname == "/Plone/" || location.pathname == "/Plone"){ document.write("STARTPAGE");}else{document.write("     <table id=\"portal-columns\">        <tbody>          <tr>            <tal:comment replace=\"nothing\"> Start of the left column </tal:comment>            <td id=\"portal-column-one\"                metal:define-slot=\"column_one_slot\"                tal:condition=\"sl\">              <div class=\"visualPadding\" style=\"margin-left:10px;\">                <metal:portlets define-slot=\"portlets_one_slot\">                  <metal:leftportlets use-macro=\"here/portlets_fetcher/macros/left_column\">                    This instruction gets the portlets (boxes) for the left column.                  </metal:leftportlets>                </metal:portlets>              </div>            </td>            <tal:comment replace=\"nothing\"> End of the left column </tal:comment>            <tal:comment replace=\"nothing\"> Start of main content block </tal:comment>            <td id=\"portal-column-content\"                tal:define=\"tabindex python:Iterator(pos=0, mainSlot=True)\"  >           <div id=\"fullscreenForm\" class=\"fullscreenForm\">           <div metal:use-macro=\"here/global_pathbar/macros/path_bar\">             The breadcrumb navigation (\"you are here\")           </div>              <metal:block define-slot=\"content\">                <div id=\"content\"                     metal:define-macro=\"content\"                     tal:define=\"show_border python:here.showEditableBorder(template_id=template_id, actions=actions );\"                     tal:attributes=\"class python:test(show_border,'documentEditable','')\">                  <metal:ifborder tal:condition=\"show_border\" >                    <div metal:use-macro=\"here/global_contentviews/macros/content_views\">                      The content views (View, Edit, Properties, Workflow)                    </div>                    <div metal:use-macro=\"here/global_contentviews/macros/content_actions\">                      The content bar                    </div>                  </metal:ifborder>                  <div class=\"documentContent\" id=\"region-content\">                    <a name=\"documentContent\"></a>                    <div metal:use-macro=\"here/global_statusmessage/macros/portal_message\">                      Portal status message                    </div>                    <metal:header metal:define-slot=\"header\" tal:content=\"nothing\">                      Visual Header                    </metal:header>                    <metal:bodytext metal:define-slot=\"main\" tal:content=\"nothing\">                      Page body text                    </metal:bodytext>                    <metal:sub metal:define-slot=\"sub\">                      <metal:discussion use-macro=\"here/viewThreadsAtBottom/macros/discussionView\" />                    </metal:sub>                  </div>                </div>              </metal:block>             </div>            </td>            <tal:comment replace=\"nothing\"> End of main content block </tal:comment>            <tal:comment replace=\"nothing\"> Start of right column </tal:comment>            <td id=\"portal-column-two\"                metal:define-slot=\"column_two_slot\"                tal:condition=\"sr\">              <div class=\"visualPadding\">                <metal:portlets define-slot=\"portlets_two_slot\">                  <metal:rightportlets use-macro=\"here/portlets_fetcher/macros/right_column\">                    This instruction gets the portlets (boxes) for the right column.                  </metal:rightportlets>                </metal:portlets>              </div>            </td>            <tal:comment replace=\"nothing\"> End of the right column </tal:comment>          </tr>        </tbody>      </table>");}