I am using dedecms v5.3
Method 1
I have not tried this method, but it should work.
Call of the Dede voting module on the homepage
This article introduces the call method of the dedecms voting module on the homepage. You can refer to the results that better suit your needs.
Let's take a look at what the voting module in the dedecms default template calls on the homepage.Code:
<! -- Voting investigation -->
<Div class = "rlist margintop">
<Form name = 'voteform' method = 'post' action = '{Dede: field name = 'phpurl'/}/vote. php' target =' _ blank '>
<Input type = 'did' name = 'dopost' value = 'send'>
<Input type = 'did' name = 'aid 'value = '1'>
<Input type = 'did' name = 'ismore' value = '0'>
<Div class = "title"> where did you find this site? </Div>
<Div class = "rbox vote">
<Span> <input name = "voteitem" type = "radio" value = "1"/> friend introduction </span>
<Span> <input name = "voteitem" type = "radio" value = "2"/> portal search engine </span>
<Span> <input name = "voteitem" type = "radio" value = "3"/> Google or Baidu search </span>
<Span> <input name = "voteitem" type = "radio" value = "4"/> links on other websites </span>
<Span> <input name = "voteitem" type = "radio" value = "5"/> other approaches </span>
<Div class = "votesubmit">
<Input type = "Submit" value = "" class = "Submit"/>
<A href = "{Dede: field name = 'phpurl'/}/vote. php? Dopost = view & Aid = 1 "> View results </a>
</Div>
</Div>
</Form>
</Div>
<! -- The voting investigation is over -->
In the Code, from form to form,
Generally, you need to modify the value attribute in the option (radio) according to the website's requirements. This value attribute is the ID corresponding to the voting option you added in the background.
Method 2
In the background, click "view code" of the vote you want to call on the home page ",
Replace the following code in the/templets/default/index.htm file:
<Div class = "Vote MT1">
<DL class = "tbox">
<DT> <strong> voting </strong> </DT>
<Form name = 'voteform' method = 'post' action = '/plus/vote. php' target =' _ blank '>
<Input type = 'did' name = 'dopost' value = 'send'/>
<Input type = 'did' name = 'aid 'value = '1'/>
<Input type = 'did' name = 'ismore' value = '0'/>
<DD> <strong> where did you find this site? </Strong>
<Div class = "FB">
<Input type = "radio" name = 'voteitem' value = '1'/>
Friend introduction </div>
<Div class = "FB">
<Input type = "radio" name = 'voteitem' value = '2'/>
Portal search engine </div>
<Div class = "FB">
<Input type = "radio" name = 'voteitem' value = '3'/>
Google or Baidu engine </div>
<Div class = "FB">
<Input type = "radio" name = 'voteitem' value = '4'/>
400 telephone network </div>
<Div class = "FB">
<Input type = "radio" name = 'voteitem' value = '5'/>
Other approaches </div>
<Div class = "Submit">
<Button type = "Submit" class = "btn-1"> vote </button>
<A href = "Plus/vote. php? Dopost = view & Aid = 1 "> View results </a> </div>
</DD>
</Form>
</Dl>
</Div>
Although this method is simple, it is not very effective.
PS: after a while, I found that the above Code can be replaced:
<! -- The following is the voting module -->
<Div class = "Vote MT1">
<DL class = "tbox">
<DT> <strong> voting </strong> </DT>
<Form name = 'voteform' method = 'post' action = '/plus/vote. php' target =' _ blank '>
<Input type = 'did' name = 'dopost' value = 'send'/>
<Input type = 'did' name = 'aid 'value = '1'/>
<Input type = 'did' name = 'ismore' value = '0'/>
<DD>
<Div class = "FB">
<! -- Paste the voting code below -->
{Dede: Vote id = '2 '}
{/Dede: Vote}
<Br/>
<! -- Paste the voting code above -->
</Div>
</DD>
</Form>
</Dl>
</Div>
<! -- The above is the voting module --> (http://www.my400800.cn /)
In this way, each time I change the voting ID marked with a special font (see the background) "2", the homepage voting module can be updated. Add a </BR> line break to ensure proper balance.
After the update, remember to update the homepage HTML in the background.