![]() |
need help on building output in template
1 Attachment(s)
hello,
i'm bussy on writing a plugin. but after a while i have the idea that what i'm doing is not right. i do the output to the webpage with echo "...." but i think i have to parse the output somehow to the template. but how do i do that. i use a table to display the user attachments. but i realy would do this in the template. i used this link to add a extra members tabhttps://vborg.vbsupport.ru/showthrea...light=profile* This is done good, the template it self is not altert, the plugin so far i have now is below. how do i output everything to the template. a specialy the table. there should be a better way than i did. please need help and or suggestions. as i have solved this, there should be : above the table a page navigation in admincp-> options a settingsfield where maxcol,maxrow, .... can be alterd. there should be an ability to alter te language of the outputed data. but hese are all next steps in my project. i have searched the inet but i'm getting stucked here. i think the messed up left colum would be oke if i put the stuff in the template. PHP Code:
|
I don't see what the stuff you've circled in red in your image has to do with your code. The code you wrote just adds a tab to your profile, which is seen on the right in your image. I don't see any code that outputs anything where you circled stuff in red.
|
no that happend when i run my code.
that is a side affect. it is somthing i work on later. it's more like should i rewrite te template so that it gets it's data from the plugin. or do i create the output in the plugin itself. if i have to rewrite the template where do i start, i couldn't find resources that helpt me with this problem. so please help me. ps. forget the red circel, this is a side effect from my plugin. |
You can either output the html directly from the plugin or use templates. It really doesn't matter which way you do it. I have a couple of added tabs on my site and I use templates in one of them and just output html in the other. So, it's personal preference.
|
so what i do is pretty normal.
can i use sanitize_pageresults in a plugin so that it render a peace of code to insert in my page? i had to try this befor using this link but there where some errors. how do i use sanitize in a plugin? |
Did you create a template memberinfo_block_mymodification? What does it look like? (Did you make it similar to the other memberinfo_block_* ?)
|
Of you follow the first post that is what i put in my template. It looks like it feta à wrong class in it's div. I don't how to alter this. It looks like it's somewhere hardcoded
|
The old template will not work for vb4.
|
oke but how do i fix it ?
do i need to register the outpu and put it that way in my template ? |
The only data that gets spit out in the template is the block_data ({vb:raw block_data.mymodification})which you are defining in the plugin, so you don't need to register any variables.
|
But why is it all meshd up? And on the first load the plugin is displayed below the About plugin.
|
Probably because your template is not using the correct css classes. If you look at your page source, the stuff that is 'showing' is class=selected_view_section, if it isn't showing (the tab isn't selected), it is class=view_section. You need to write a condition at the top of your template to define which class is used in your div (<vb:if condition="$selected_tab == 'mymodification'"> class="selected_view_section"<vb:else />class="view_section"</vb:if>)
|
that's correct, mymodification has the class Block, all the other have view_section and one has selected_view_section.
that isn't going to work, i had to try that before. look below for what is outputed: i have trying a lot but i can't get i to work. PHP Code:
|
I don't understand what you are printing out there - that shouldn't be your template, so what is it?
|
that is the code what my members page give after rendering, and after inserting the code you gave in post 12.
at the bottom of the code you coulld see what it gave as output. and that is not what my plugin should give. i put the code just before the hook location at the bottom of the members template. [edit] code added plugin code, hook location: members_hook_location_start PHP Code:
Template : memberinfo_block_mymodification PHP Code:
PHP Code:
|
The code I posted was not complete code. It was code you will need to use in your custom template that you need to create for your tab. The article tells you to create a template. You CANNOT use the code she posted since it is vb3 template code. What does your template look like (you should look at other tabs and see what code is needed) and what is it called (it should be called memberinfo_block_mymodification)
|
my template says
PHP Code:
PHP Code:
when i look at, memberinfo_block_aboutme, there is only html code and some vb stuff not rellated to this problem. i realy don't know. maybe it would help if i could find the hook location is a template, but when i search the templates it comes up with no hits. maybe it's me, that i'm a beginner. so when it's to much trouble leave it and close this treaht. i'm stuck on this for 4 days now, i becom a bit crazy --------------- Added [DATE]1262378496[/DATE] at [TIME]1262378496[/TIME] --------------- lynne,maybe you have a peace of working plugin and template, so i could see how you did it? |
You aren't putting 'names' above any of your template code so I can't tell what templates you are posting (nor can I tell why you have two - you should only have one, I would think).
I didnt' really want to post my template because it is on my RC4 site - I haven't upgraded that particular test site to Gold yet. However, here is mine which will hopefully work on gold. template name - memberinfo_block_mytorrentstats PHP Code:
|
and your plugin looks like what i have except for what it's given back. but building the block and giving back it's content.
the template name where i speake about is memberinfo_block_mymodification block_data.mytorrentstats is what you get back from your plugin ? |
Ours are similar. One mistake you are making in yours is that you are not allowed to use the same id twice on a page. You are. I don't know if that is causing the problem, but it always helps to get rid of any html/css errors to eliminate those as the culprit.
|
it still isn't going to work !
it shows nothing, still keeping the 2 div lines. within the first line class is block. and no output is showing. i think it is in my plugin but i can't find simmular mod's/plugins to see how they did it. my template name is now: memberinfo_block_mymodification [PHP]<div id="view-mymodification" <vb:if condition="$selected_tab == 'mymodification'"> class="selected_view_section"<vb:else />class="view_section"</vb:if>> <h3 class="subsectionhead">Bijlages</h3> {vb:raw block_data.mymymodification} </div> <div class="underblock"></div> <!-- / {vb:raw id} --> [/PHP plugin name extra tab PHP Code:
|
After some help from lynne, whe finnaly mannaged to get this plugin to work
what was wrong, in the plugin there should be an extra line wrap = false, see a part of the plugin. PHP Code:
|
All times are GMT. The time now is 12:21 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|