Sphene Community Tools

Community

Copyright © 2007-2018 by Herbert Poul

You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools
Board » General » Thread and Category embedding

Page: 1 2 Next

Hi, I've been trying to adapt the code from the wiki display and the tutorial posts to embed a thread into a page. It doesn't seem to be displaying the thread though, just getting info from the first line in the _comments.html template.
hi,
i'm not sure what exactly you want.. enabling comments for the wiki? or showing one forum thread within a wiki page?
Hey, we have Signatures !!! Great, isn't it ? ;)
Holy shit you are fast.

Actually I'm trying to embed a thread within my own model/view. What I want to do is allow users to comment on other users profiles. What I'm trying to do is create a post on user creation and attach it to their profile.
That's the end goal anyway. Right now I'd be happy if it even displayed a whole category thread list like the wiki comments does.

#-------------------Snippet
{% sphcomments_load_infos UserProfile %}
<h3>{{ threadlist.get_object_count }} Comments</h3>
{% if user.is_authenticated %}
<p>{% include "sphene/sphboard/_category_monitor.html" %}</p>
{% endif %}
{% if threadlist.get_object_count %}
{{ threadlist }}
{% else %}
<p>{% trans "No comments yet." %}</p>
{% endif %}
{% include "sphene/sphboard/_new_thread_link.html" %}
{% endsphcomments_load_infos %}

#------------------End Snippet

So {% sphcomments_load_infos UserProfile %} gets the self view from my UserProfile class but everything after that doesn't show.


--- Last Edited by mkowalski at 2009-05-13 21:36:56 ---
hmm.. so the template variable UserProfile is an instance of your user profile? ie. {{ UserProfile.id }} gives you the id for this user's profile?

do you see any error messages or something like it? is it doing something in the database? try something like:

select * from sphcomments_commentscategoryconfig where object_id = 7;

and replace 7 with the object id for a sample user profile id ..
Hey, we have Signatures !!! Great, isn't it ? ;)
Yep, it's there.
i fear you have to help me debugging a bit :)

so i guess there are no posts yet in that thread.. so .. we need to get the post form to display first..

so if you don't see the 'Post New Thread' link, open:

communitytools/sphenecoll/sphene/sphboard/templates/sphene/sphboard/_new_thread_link.html

enter some text there to see if it is included correctly.. then afterwards {% if category %}, etc. any of those ifs have to be wrong i guess?
Hey, we have Signatures !!! Great, isn't it ? ;)
Grah, I think I made a more basic mistake but don't really know.

Nothing is displaying in my comments block now. Prior to that any flat text I was putting in before and after all ifs wasn't displaying either.
Now I'm getting
Caught an exception while rendering: 'str' object has no attribute '_meta'
when it get the load_infos

Does that mean I need to make a form for it?

--- Last Edited by mkowalski at 2009-05-13 22:20:59 ---
no, but i guess you are passing a string into load_infos instead of a model instance?

maybe you could paste me the stacktrace
Hey, we have Signatures !!! Great, isn't it ? ;)

Page: 1 2 Next

Please login to post a reply.



Powered by Sphene Community Tools