ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Using channel search with relationship field types

February 17, 2010 8:32pm

Subscribe [1]
  • #1 / Feb 17, 2010 8:32pm

    arteylogica

    37 posts

    I will try to explain the problem I am having the best I can.

    I am using EE2.0.1.

    I have a portfolio site. On one channel I have clients. On another client I have projects. Projects has a relationship field type named clients. For each client there are 4 different types of projects (website, microsite, marketing and branding). I want to display the available projects for each client’s page. If Client A has a website and branding, only these channels should show in the template. If there is more than one website for Client A, only the last one added should show.

    I know you cannot search relationship filed types. (http://expressionengine.com/public_beta/docs/modules/channel/parameters.html#par_search). Is there an add-on that offers a solution to this?

    Here is my code:

    Project menu code

    Ideally I would have added a search:cliente == “Client Name” as a parameter, but this feature is not supported.

    <div id="menu-proyecto" class="span-16">
        <ul class="tabs">
            {exp:channel:entries channel="proyecto" limit="4" sort="asc" dynamic="off"}
            {if tipo == "Sitio Web"}
            <li><a href="#">Sitio web</a></li>
            {/if}
            {if tipo == "Micro Sitio"}
            <li><a href="#">Micro Sitio</a></li>
            {/if}
            {if tipo == "Mercadeo Web"}
            <li><a href="#">Mercadeo Web</a></li>
            {/if}
            {if tipo == "Branding"}
            <li><a href="#">Branding</a></li>
            {/if}
            {/exp:channel:entries}
        </ul>
    </div>

    Each of the projects will have this code.

    {exp:channel:entries channel="proyecto" limit="1" search:tipo="Sitio Web"}
        <div id="sub-1">
            <div class="img-proyecto span-16">
                <a href="http://{url_proyecto}">{proyect_img}</a>
            </div><!-- end blog post -->
            <div class="span-16 pdash">
                <div class="info-proyecto iptop span-16">
                    <div class="span-8">
                        <div id="desc-proyecto">
                            <h3>Del Proyecto:</h3>
    <p>                        {proyect_desc}<br />
                            <div class="visitar"><br />
                                <a href="http://{url_proyecto}">Visitar Proyecto</a><br />
                            </div><br />
                        </div><br />
                    </div><br />
                    <div class="span-8 last"><br />
                        <div id="invol-proyecto"><br />
                            </p><h3>Participación:</h3>
    <p>                        {involucramiento markup="ul"}<br />
                        </div><br />
                    </div><br />
                </div><!-- end info proyecto --><br />
                <div class="info-proyecto ipbottom span-16"><br />
                    <div class="span-8"><br />
                        <div id="test-proyecto"><br />
                            </p><h3>Testimonio:</h3>
    <p>                        {proyect_test}<br />
                        </div><br />
                    </div><br />
                    <div class="span-8 last"><br />
                        <div id="colab-proyecto"><br />
                            {related_entries id="colaborador"}<br />
                            </p><h3>En colaboración con:</h3>
    <p>                        <a href="http://{url_colaborador}">{logo_colaborador}</a><br />
                            {/related_entries}<br />
                        </div><br />
                    </div><br />
                </div><!-- end info-proyecto --><br />
            </div><!-- end pdash --><br />
        </div><!-- end sub-1--><br />
        {/exp:channel:entries}

    Thanks in advance for the help.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases