lastdance (
lastdance) wrote in
style_system2009-05-05 09:26 pm
Entry tags:
Calling functions in other classes
I've been reading S2 documentation like crazy, and I'm pretty sure the answer is 'no' but I'm going to throw out the question anyway:
Is there any possible way to call functions from a different view than the one you're currently on? For example, the EntryPage class has a function print_comments. But what if I want to print the subjects of the 5 latest comments on the Recent view (maybe in the sidebar)? The RecentPage class doesn't include that function, so I'm assuming there's no way to call it unless the core was rewritten to add it into RecentPage and allow it to take parameters so it knows which comments to pull back. Am I correct in that assumption?
I'll gladly take the question elsewhere if this isn't the right place. Any direction would be so much appreciated.
Is there any possible way to call functions from a different view than the one you're currently on? For example, the EntryPage class has a function print_comments. But what if I want to print the subjects of the 5 latest comments on the Recent view (maybe in the sidebar)? The RecentPage class doesn't include that function, so I'm assuming there's no way to call it unless the core was rewritten to add it into RecentPage and allow it to take parameters so it knows which comments to pull back. Am I correct in that assumption?
I'll gladly take the question elsewhere if this isn't the right place. Any direction would be so much appreciated.
Re: Flimsy Suggestion
My code snippet is similar. I'm using the print_module_pagesummary method as an example, since it prints either the post subjects or the comment subjects depending which page it's called from. I assume to get comment subjects, I would have to put another foreach inside foreach var Entry in the RecentPage section. However...
RecentPage contains Entry, which contains class CommentInfo, which doesn't include any of the content of the comments, just how many there are, whether they're screened, etc. It's the EntryPage class itself that contains class Comments, which does include the comment content. I guess I'm blindly looking for the bridge between the two or if there is one.
Re: Flimsy Suggestion
Re: Flimsy Suggestion
Re: Flimsy Suggestion