Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-10-01 03:45:43

ajw-art
Member
Registered: 2010-02-10
Posts: 33

Outputting article components to different sections of page

I’m trying to setup a gallery site where each item in my portfolio is its own article, and the various components are output in different sections of the page. In this case, I want the article title and excerpt to be in the left sidebar, and the article image and body, as well as the navigation, to be in the content area to the right.

I’d hoped this could be accomplished by wrapping all of the desired page sections in an article tag with a limit of 1, but alas, no dice. The page stops rendering as soon as it hits the article tag. I’m wondering if what I want is even possible.

<txp:output_form form="head" />

<txp:article limit="1">
<aside>
            <h1><txp:title /></h1>
            <p><txp:excerpt /></p>
            <txp:if_custom_field name="sitelink">
<a href="<txp:custom_field name="sitelink">" title="<txp:title />"><txp:image id="8" class="gen" /></a>
</txp:if_custom_field>
                <!--<txp:image id="10" html_id="arrow" />-->
        </aside>

        <section id="content">

        <div><p>Featured Work</p></div>

            <div id="carousel">
                <txp:article_image />

            </div>

        </section>

    <footer>
        <txp:body />
    </footer>
</txp:article>

<txp:output_form form="foot"/>

Any thoughts? (You know, I never figured out how to end a code snippet in textile. It’s quite annoying.)

Last edited by maniqui (2010-10-01 04:09:07)

Offline

#2 2010-10-01 04:11:09

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Outputting article components to different sections of page

Hi ajw-art

this:
<txp:custom_field name="sitelink">
should be:
<txp:custom_field name="sitelink" />.

May that fix your page rendering issue?

BTW, hit the “Edit” button to see how to end a code snippet in textile ;)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2010-10-01 04:26:48

ajw-art
Member
Registered: 2010-02-10
Posts: 33

Re: Outputting article components to different sections of page

I didn’t even notice I hadn’t closed the custom_field; I’ve been staring at this code for too long. Unfortunately, no, the page still won’t render. Would the debug information help?

<!-- Runtime:    0.0343 -->
<!-- Query time: 0.014527 -->
<!-- Queries: 17 -->
<!-- Memory: 3134Kb, <txp:output_form form="foot"/> -->
<!-- txp tag trace: 
[SQL (0.0027029514312744): select name, data from txp_lang where lang='en-gb' AND ( event='public' OR event='common')]
[SQL (0.0011899471282959): select name, code, version from txp_plugin where status = 1 AND type IN (0,1) order by load_order]
[SQL (0.0011639595031738): select name,code,version from txp_plugin where status = 1 AND name='smd_lib']
[SQL (0.0013868808746338): select name,code,version from txp_plugin where status = 1 AND name='soo_plugin_pref']
[SQL (0.00045990943908691): select page, css from txp_section where name = 'print' limit 1]
[SQL (0.00043988227844238): select host from txp_log where ip='127.0.0.1' limit 1]
[SQL (0.00049614906311035): insert into txp_log set `time`=now(),page='/public/index.php?s=print',ip='127.0.0.1',host='127.0.0.1',refer='',status='200',method='GET']
[SQL (0.00037193298339844): select user_html from txp_page where name='portfolio']
[Page: portfolio]
<txp:output_form form="head" />
    [SQL (0.00039410591125488): select Form from txp_form where name='head']
    [Form: head]
    <txp:site_name/>
    <txp:if_section name="default">
        [<txp:if_section name="default">: false]
    </txp:if_section>
    <txp:link_to_home>
        <txp:image id="4"/>
            [SQL (0.00043797492980957): select * from txp_image where id = 4 limit 1]
    </txp:link_to_home>
    <txp:section_list sections="print,web,contact" wraptag="ul" break="li"/>
        [SQL (0.00069594383239746): select name, title from txp_section where name in ('print','web','contact') order by field(name, 'print','web','contact')]
    <txp:image id="5" />
        [SQL (0.00072908401489258): select * from txp_image where id = 5 limit 1]
    <txp:image id="6" />
        [SQL (0.00067806243896484): select * from txp_image where id = 6 limit 1]
<txp:article limit="1">
    [SQL (0.00070095062255859): select count(*) from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('print')]
    [SQL (0.00084495544433594): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('print') order by Posted desc limit 0, 1]
</txp:article>
<txp:output_form form="foot"/>
    [SQL (0.00065994262695312): select Form from txp_form where name='foot']
    [Form: foot]
[ ~~~ secondpass ~~~ ]
 -->

My installation’s a bit screwy as I’m running it on a multisite install using WAMP, and some of things (plugin interfaces, advanced options on articles, and various other admin-side components) aren’t showing up. I doubt that has anything to do with it since my homepage is rendering correctly, but I figured I’d throw it out there just in case.

And now I know how to end a code snippet. Brilliant! Thanks. :)

Last edited by ajw-art (2010-10-01 04:27:08)

Offline

#4 2010-10-01 10:57:27

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Outputting article components to different sections of page

ajw-art wrote:

I’d hoped this could be accomplished by wrapping all of the desired page sections in an article tag with a limit of 1, but alas, no dice. The page stops rendering as soon as it hits the article tag. I’m wondering if what I want is even possible.

Appears the article tag isn’t returning any articles. Do you have current, live articles assigned to section “print”?

My installation’s a bit screwy as I’m running it on a multisite install using WAMP, and some of things (plugin interfaces, advanced options on articles, and various other admin-side components) aren’t showing up. I doubt that has anything to do with it since my homepage is rendering correctly, but I figured I’d throw it out there just in case.

Doesn’t sound very reassuring.


Code is topiary

Offline

#5 2010-10-01 12:08:27

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Outputting article components to different sections of page

The HTML5 tags can’t have anything to do with this, can they?

Offline

#6 2010-10-04 00:53:49

ajw-art
Member
Registered: 2010-02-10
Posts: 33

Re: Outputting article components to different sections of page

As I was running into so many problems with my local install, I started a new database on my webhost, uploaded the site and voila— the problem was resolved. Just some crazy thing with the local host, I guess. Thanks everyone!

Offline

Board footer

Powered by FluxBB