Advanced Forum - Topicnyitó hozzászólás a kommentek alatt - 2.

The spam filter installed on this site is currently unavailable. Per site policy, we are unable to accept new submissions until that problem is resolved. Please try resubmitting the form in a couple of minutes.
Kategória: 
Leírás

Az előző postban azt néztük meg, hogyan kerül a topicnyitó hozzászólás node, amelyhez hozzá lehet szólni, a kommentek alá. Most nézzük, hogyan fog ez úgy kinézni, ahogy kellene!

Aki használt már views-t, és css-ben dolgozott vele az tudja, hogy egy nézet előállításakor rengeteg div is keletkezhet, saját views-osztályokkal, ami alapból nagyon jó, hiszen megkönnyíti a vele való munkát. Most is nekieshetnénk, és CSS-ben belőve a megfelelő osztályokat össze tudnánk szedni a dolgokat, de minek dolgozzunk kétszer?

Ha már egyszer megformáztuk a fórumunkat, most nyaljuk végig az összes beállítást, és végezzük el a views által generált css classokra is?

Miért ne pakolhatnám inkább a kész, megformázott osztályokat a létrehozott views-ba? Ráadásul, ha később módosítanom kell, akkor sem kétszer dolgozok.

Építsünk fel tehát egy comment wrappert, és töltsük bele a szükséges adatot!

Fontos! Ha a továbbiakban leírtak kínainak tűnnek, ezt mindenképpen olvasd el! Direkt ennek a megértéséhez-kivitelezéséhez készült, mert egy postban túl tömény és hosszú lett volna!

Az előző postban létrehoztunk tehát egy nézetet, és egy blokkban jelenítettük meg a topicnyitó hozzászólást. Most ennek az alnézetnek a Display output-jánál a views-view.tpl.php-ban cseréljük le az eredeti kódot, és views-view--nezet_neve--block-1.tpl.php néven mentsük el:

  <div id="myblock-<?php print $id; ?>" class="top-post forum-post comment comment-published node node-type-forum clear-block">
  <?php print $rows; ?>
  </div>
 

Ezzel semmi mást nem csináltunk, csak deklaráltuk a blokkot, és felruháztuk azokkal az osztályokkal, amiket a node megjelenésekor generál. Ezt lehetne elegánsabban is, mondjuk egy views preprocess-ben használni a $class tömböt, de ha nem akarjuk nagyon széttúrni a fórum tartalomtípus megjelenését más miatt, szvsz nem szükséges.

A Style-outputnál utoljára szereplő filenéven (views-view-unformatted--topicindito-hsz--block-1.tpl.php) hozzuk létre a template file-t az alábbi tartalommal:

  <div class="forum-post-wrapper">
<?php foreach ($rows as $id => $row): ?>
    <?php print $row; ?>
<?php endforeach; ?>
  </div>

Itt megkapja a forum-post-wrapper classt, pont úgy, mint bármilyen más hozzászólás.

A Row Style outputnál utoljára szereplő filenéven (views-view-fields--topicindito-hsz--block-1.tpl.php) hozzuk létre a template file-t az alábbi tartalommal:

<?php foreach ($fields as $id => $field): ?>
<?php print $field->content; ?>
<?php endforeach; ?>

Ezzel "sallangtalanítjuk" a nézetet, nincs szükségünk a views által a mezők köré pakolt osztályokra. Ezeket az osztályokat mi magunk adjuk meg egyesével minden egyes mező köré.

Ezután egyesével szerksztjük a mezőket. Itt is mindig az utolsó file-néven mentsük el a tpl-eket (views-view-field--topicindito-hsz--block-1--mezo_neve.tpl.php).

Field Customfield: PHP kód (ID: phpcode) tplje:

<div class="forum-post-panel-sub">
<?php print $output; ?>
</div>

A Field Tartalom: Post date (ID: created) tpl-jébe ez kerül:

<div class="post-info clear-block ">
    <div class="posted-on"> 
        <?php print $output; ?>
    </div>
</div>

És végül a Field Tartalom: Törzs (ID: body)

<div class="forum-post-panel-main clear-block">
    <div class="content">
<?php print $output; ?>
    </div>
</div>

Ha leellenőrzitek egy komment szerkezetét, látszik, hogy pontosan ugyanígy épülnek fel a kommentek mezői.

Ezután töltsétek fel ezeket a tpl-eket a smink könyvtárában, vagy theme registry törléssel, vagy a views Theme information-nál Rescan template-re kattinva máris az új szerkezet szerint látjátok a nézetet.

Ja, és még van egy dolgunk, eltűntetni a legfelső hozzászólást.

Ehhez egy advf-forum-post.tpl.php nevű file-t hozz létre a smink könyvtárába ezzel a tartalommal, majd ürítsd a theme registry-t.

<?php
// $Id: advf-forum-post.tpl.php,v 1.1.2.21 2009/02/07 04:40:48 michellec Exp $

/**
 * @file
 *
 * Theme implementation: Template for each forum post whether node or comment.
 *
 * All variables available in node.tpl.php and comment.tpl.php for your theme
 * are available here. In addition, Advanced Forum makes available the following
 * variables:
 *
 * - $top_post: TRUE if we are formatting the main post (ie, not a comment)
 * - $reply_link: Text link / button to reply to topic.
 * - %total_posts: Number of posts in topic (not counting first post).
 * - $new_posts: Number of new posts in topic, and link to first new.
 * - $links_array: Unformatted array of links.
 * - $account: User object of the post author.
 * - $name: User name of post author.
 * - $author_pane: Entire contents of advf-author-pane.tpl.php.

 */
?>

<?php if (!$top_post): ?>
  <?php $classes .= $comment_classes; ?>
  <div id="comment-<?php print $comment->cid; ?>" class="forum-post <?php print $classes; ?> clear-block">

  <div class="forum-post-wrapper">

    <div class="forum-post-panel-sub">
      <?php print $author_pane; ?>
    </div>
  <div class="post-info clear-block">
    <div class="posted-on">
      <?php print $date ?>

      <?php if (!$top_post && !empty($comment->new)): ?>
        <a id="new"><span class="new">(<?php print $new ?>)</span></a>
      <?php endif; ?>
    </div>

    <?php if (!$top_post): ?>
      <span class="post-num"><?php print $comment_link . ' ' . $page_link; ?></span>
    <?php endif; ?>
  </div>
    <div class="forum-post-panel-main clear-block">
      <div class="content">
        <?php print $content ?>
      </div>

      <?php if ($signature): ?>
        <div class="author-signature">
          <?php print $signature ?>
        </div>
      <?php endif; ?>
    </div>
  </div>

  <div class="forum-post-footer clear-block">
    <div class="forum-jump-links">
      <a href="#top" title="Jump to top of page"><?php print t("Top"); ?></a>
    </div>

    <?php if (!empty($links)): ?>
      <div class="forum-post-links">
        <?php print $links ?>
      </div>
    <?php endif; ?>
  </div>
</div>
<?php endif; ?>

Ha minden jól megy, most dettó ugyanazt kaptad alul, mint korábban felül. Előfordulhat, hogy css-ben még itt-ott igazítani kell hozzá, sőt, azt is lehet, hogy nem blokkban, hanem egy megfelelő page.tpl-ban az embed_views függvénnyel a $content után íratod ki a views-t, és akkor a block felépítése sem kavar bele, de mivel ez a post már így is elég hosszú lett, ezért nem részletezem..

Jó próbálgatást!

Hozzászólások

We absolutely love your blog

We absolutely love your blog and find a lot of your post's to be what precisely I'm looking for. Would you offer guest writers to write content for you? I wouldn't mind publishing a post or elaborating on a lot of the subjects you write about here. Again, awesome web log!|

This is really interesting,

This is really interesting, You're a very skilled blogger. I've joined your feed and look forward to seeking more of your fantastic post. Also, I've shared your website in my social networks!|

Hi there, I discovered your

Hi there, I discovered your web site via Google while looking for a similar topic, your web site got here up, it appears to be like great. I have bookmarked it in my google bookmarks.

For the reason that the admin

For the reason that the admin of this site is
working, no doubt very quickly it will be well-known,
due to its quality contents.
Jay's Santa Clarita Tree Removal Kings
26174 Las Lanas Ct, Santa Clarita, CA 91355
661-464-1270
laureljefferson09875 [at] gmail [dot] com

Hi there it's me, I am also

Hi there it's me, I am also visiting this web site daily, this web page is
genuinely pleasant and the visitors are actually sharing nice thoughts.

I have been browsing online

I have been browsing online more than 3 hours nowadays, but
I never found any attention-grabbing article like yours.
It is lovely worth enough for me. In my view, if all webmasters and bloggers made good content as you probably did, the net will likely be a lot more useful than ever before.

What's up i am kavin, its my

What's up i am kavin, its my first time to commenting anyplace,
when i read this article i thought i could also make comment due to this good
article.

Excellent post. I was

Excellent post. I was checking constantly this weblog and I'm inspired!

Very helpful information specially the remaining phase :) I
handle such information much. I used to be seeking this
certain information for a very long time. Thank you and
good luck.

constantly i used to read

constantly i used to read smaller articles that also clear their motive, and that is also happening with this article which I am reading here.|

Hey there would you mind

Hey there would you mind letting me know which web host you're working with?
I've loaded your blog in 3 completely different
browsers and I must say this blog loads a lot faster then most.
Can you suggest a good web hosting provider at a fair price?
Cheers, I appreciate it!
Jim's San Jose Carpet Cleaning
780 S 3rd St, San Jose, CA 95112
3408-351-1063
colettemackie2641 [at] gmail [dot] com

Howdy! I'm at work browsing

Howdy! I'm at work browsing your blog from my new iphone
3gs! Just wanted to say I love reading your blog and look forward to
all your posts! Carry on the outstanding work!

You actually make it seem so

You actually make it seem so easy with your presentation but I find this topic to be actually something which
I think I would never understand. It seems too complex and very broad for
me. I'm looking forward for your next post, I'll try to get the hang of
it!

Hi are using Wordpress for

Hi are using Wordpress for your site platform? I'm new to the blog
world but I'm trying to get started and set up my own. Do you
require any coding knowledge to make your own blog? Any help would be greatly
appreciated!

Very good information. Lucky

Very good information. Lucky me I recently found your site by accident (stumbleupon).
I have bookmarked it for later!

Hello friends, its great post

Hello friends, its great post regarding teachingand entirely explained, keep it up all the time.

It's a shame you don't have a

It's a shame you don't have a donate button! I'd definitely
donate to this fantastic blog! I suppose for now i'll settle for bookmarking and
adding your RSS feed to my Google account. I look forward to brand
new updates and will share this blog with my Facebook group.
Chat soon!

Helpful information. Lucky me

Helpful information. Lucky me I discovered
your site by chance, and I'm stunned why this coincidence didn't took place earlier!

I bookmarked it.

This is really interesting,

This is really interesting, You are a very
skilled blogger. I've joined your feed and look forward to seeking more of
your great post. Also, I have shared your web site in my
social networks!

Hello! Do you know if they

Hello! Do you know if they make any plugins to assist with Search
Engine Optimization? I'm trying to get my blog to rank for some targeted keywords
but I'm not seeing very good results. If you know of any please share.

Many thanks!

Right away I am going away to

Right away I am going away to do my breakfast, later than having my breakfast coming yet again to read
other news.
Jim's San Jose Carpet Cleaning
780 S 3rd St, San Jose, CA 95112
3408-351-1063
colettemackie2641 [at] gmail [dot] com

This piece of writing is

This piece of writing is genuinely a good one it assists new the web visitors, who are wishing for blogging.|

Heya i'm for the first time

Heya i'm for the first time here. I found this board and I
find It truly useful & it helped me out much. I hope to give something back and aid others like you aided me.

M.E.C Mon Electricien

M.E.C Mon Electricien Catalan
44 Rue Henry de Turenne
66100 Perpignan
0651212596

Electricien Perpignan

hello there and thank you for your information – I've definitely picked up something new from right here.
I did however expertise several technical points using this website, as I
experienced to reload the web site a lot of times previous to I could
get it to load properly. I had been wondering if your web host is OK?
Not that I'm complaining, but sluggish loading instances times will very frequently affect your placement in google and
can damage your quality score if advertising and marketing with Adwords.
Anyway I'm adding this RSS to my e-mail and can look out for a lot more of your respective fascinating content.
Make sure you update this again soon.

I enjoy, cause I discovered

I enjoy, cause I discovered just what I used to be taking a look for.
You have ended my four day lengthy hunt! God Bless you man. Have a
nice day. Bye

Very good post! We will be

Very good post! We will be linking to this particularly
great content on our website. Keep up the great writing.

Hi! Do you use Twitter? I'd

Hi! Do you use Twitter? I'd like to follow you if that would be ok.
I'm definitely enjoying your blog and look forward to new posts.

Thanks for finally talking

Thanks for finally talking about >Válasz a hozzászólásra

For latest information you

For latest information you have to go to see internet and on world-wide-web I found this site as a finest website for most up-to-date updates.

Superb post however I was

Superb post however I was wondering if you could write a litte more on this subject?
I'd be very grateful if you could elaborate a little
bit more. Kudos!

Hi it's me, I am also

Hi it's me, I am also visiting this web page regularly,
this web site is actually good and the visitors are in fact sharing good thoughts.

Jim's San Jose Carpet Cleaning
780 S 3rd St, San Jose, CA 95112
3408-351-1063
colettemackie2641 [at] gmail [dot] com

I always used to read article

I always used to read article in news papers but
now as I am a user of internet so from now I am using net for
articles, thanks to web.

Exceptional post but I was

Exceptional post but I was wondering if you could
write a litte more on this topic? I'd be very grateful if you could elaborate a little bit more.
Cheers!

Your means of explaining

Your means of explaining everything in this article is really good, every one
be able to easily know it, Thanks a lot.

First off I want to say

First off I want to say awesome blog! I had a quick question that
I'd like to ask if you do not mind. I was interested to find out how you center yourself and clear your thoughts before writing.
I've had trouble clearing my mind in getting my thoughts out.
I truly do take pleasure in writing however it just seems
like the first 10 to 15 minutes tend to be lost simply just trying to figure
out how to begin. Any recommendations or tips? Thank you!

Hi friends, how is

Hi friends, how is everything, and what you would like to say concerning this piece of writing, in my
view its really awesome for me.

This paragraph is actually a

This paragraph is actually a good one it helps new web visitors, who are wishing for blogging.|

Taxi moto line 128 Rue la

Taxi moto line
128 Rue la Boétie
75008 Paris
+33 6 51 612 712  

Taxi moto paris

It is in reality a great and useful piece of info.
I am satisfied that you simply shared this helpful info
with us. Please stay us up to date like this.
Thanks for sharing.

Thanks for the marvelous

Thanks for the marvelous posting! I really enjoyed reading it, you may be a great author.
I will remember to bookmark your blog and will often come back someday.
I want to encourage continue your great job, have a nice holiday weekend!

Everyone loves what you guys

Everyone loves what you guys are up too. This sort of clever
work and reporting! Keep up the amazing works guys I've added you guys
to blogroll.

You have made some decent

You have made some decent points there. I checked on the web to learn more about the issue and found most people will go
along with your views on this site.

Asking questions are

Asking questions are genuinely pleasant thing if you are not
understanding something fully, however this paragraph presents good
understanding yet.

Independance Immobilière -

Independance Immobilière - Agence Dakar Sénégal
Av. Fadiga, Immeuble Lahad Mbacké
BP 2975 Dakar
+221 33 823 39 30

Agence Immobilière Dakar

An outstanding share! I've just forwarded this onto a colleague who had been doing
a little research on this. And he actually bought me breakfast due to the
fact that I discovered it for him... lol. So allow me to reword this....

Thank YOU for the meal!! But yeah, thanx for spending some time to discuss
this topic here on your internet site.

Hi there! This is kind of off

Hi there! This is kind of off topic but I need some help from
an established blog. Is it very hard to set up your own blog?
I'm not very techincal but I can figure things out pretty quick.
I'm thinking about making my own but I'm not sure
where to start. Do you have any points or suggestions? Cheers

It's amazing designed for me

It's amazing designed for me to have a web page,
which is valuable in favor of my knowledge. thanks admin
Jay's Santa Clarita Tree Removal Kings
26174 Las Lanas Ct, Santa Clarita, CA 91355
661-464-1270
laureljefferson09875 [at] gmail [dot] com

I would like to thank you for

I would like to thank you for the efforts you have put in penning this website.

I am hoping to see the same high-grade blog posts by you later on as well.
In truth, your creative writing abilities has encouraged me to get my own blog now ;)

What's up, for all time i

What's up, for all time i used to check web site posts here in the early hours
in the morning, because i enjoy to find out more and more.

Do you have any video of

Do you have any video of that? I'd like to find out some additional information.
Jay's Santa Clarita Tree Removal Kings
26174 Las Lanas Ct, Santa Clarita, CA 91355
661-464-1270
laureljefferson09875 [at] gmail [dot] com

I've been browsing online

I've been browsing online more than 3 hours today,
yet I never found any interesting article like yours.
It's pretty worth enough for me. Personally, if all
webmasters and bloggers made good content as you did, the internet will be much more useful than ever before.

Appreciate the

Appreciate the recommendation. Let me try it out.

Hello there, There's no doubt

Hello there, There's no doubt that your blog may be having browser compatibility problems.
When I take a look at your web site in Safari, it looks fine however, if opening in IE,
it has some overlapping issues. I simply wanted to give you a quick
heads up! Other than that, excellent blog!

Hozzászólás

A mező tartalma nem nyilvános.
  • Internal paths in double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or relative path.
  • Engedélyezett HTML elemek: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <del> <img>
  • A webcímek és email címek automatikusan linkekké alakulnak.
  • A sorokat és bekezdéseket a rendszer automatikusan felismeri.
  • Engedélyezett HTML elemek: <a> <blockquote> <br> <cite> <code> <dd> <del> <div> <dl> <dt> <em> <li> <ol> <p> <span> <strong> <ul>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <mysql>, <php>, <python>, <ruby>, <sql>. The supported tag styles are: <foo>, [foo].
  • Minden email cím át lesz alakítva ember által olvasható módon, vagy (ha a JavaScript engedélyezett) ki lesz cserélve kattintható, de biztonságos hivatkozásra.