1

私のBloggerブログでは、このコードがテンプレートに含まれています

<b:if cond='data:blog.pageType == &quot;index&quot;'>

<b:else/>
<p><data:post.body/></p>
</b:if>

このコードは基本的に、個々のブログページにある場合にのみブログ投稿の本文を表示します。

ここで例を見ることができますwww.spoilertv.comホームページにいるときは、投稿のタイトルだけが表示されます。タイトルをクリックすると、投稿全体が表示されます。

私がやりたいのは、ブログの読者に、投稿の本文をホームページに表示するかどうかを選択できるようにすることです。

「フルコンテンツを表示」のようなブログに配置できるシンプルなラジオボタンまたはチェックボックスが欲しいのですが。これはデフォルトでオフになっています。ユーザーがクリックすると、Jqueryを使用してCookieを設定し、ページをリロードします。

Cookieは、ユーザーが後でサイトに戻った場合にユーザーの設定を記憶し、それに応じて表示するために使用されます。

上記のコードは、Cookieの値をチェックし、フルコンテンツに設定されている場合は表示されるように、更新する必要があります。このような擬似コード。

<b:if cond='data:blog.pageType == &quot;index&quot;'>

if cookie is set to full content then
<p><data:post.body/></p>
endif

<b:else/>
<p><data:post.body/></p>
</b:if>

誰かがこの小さなプロジェクトで私を助けてくれるなら、私はとても感謝しています。

助けてくれてありがとう。

4

1 に答える 1

1

I'm a wordpress dev, so not too familiar with blogger, but will try to help you out anyways.

If blogger is similar to WP, then it's not a matter of hiding or showing the content that's already being generated on the page. (which is what JQ would do for you). Your first step is to get the content to show up.

And i know it can be done in blogger - here's an example:

http://photographybyspandan.blogspot.com/

plus did a test post here: http://siberianx37thoughts.blogspot.com/

I think it's a setting you can set in blogger to display full post title.

Then, you can edit the template, and wrap the post in an element. In this case it's p so just add a specific class to it. then use jquery to hide / show that element

http://www.learningjquery.com/2006/09/basic-show-and-hide

You can use firebug for firefox to help you too :)

于 2010-07-14T12:38:13.167 に答える