Jump to content

How to add Suggest Box in Video View page?


xvids
 Share

Recommended Posts

It is the same functionality as report video:

 

flag_suggest_model.thumb.png.9f0319ca26a4e1f605ba86b60185f87a.png

 

It uses flags to report some text message for a video. What you need is to create a new flag for this, e.g. flag_suggest_model and then duplicate flagging form but replace raio button group with hidden input that locks flag ID.

 

You can also find example of this form in default template of video_view block: Website UI -> Page blocks overview -> video_view.

Link to comment
Share on other sites

Hi,

 

Can please post a tutorial step by step.

 

Because I already try:

 

{{if count($data.tags)>0}}
                               <div class="item">
                                   {{$lang.videos.video_details_label_tags}}:
                                   {{foreach item="item" from=$data.tags}}
                                       <a {{if $lang.enable_tags=='true'}}href="{{$lang.urls.videos_by_tag|replace:"%DIR%":$item.tag_dir|replace:"%ID%":$item.tag_id}}"{{/if}}>{{$item.tag}}</a>
                                   {{/foreach}}
                                   <button onclick="myFunction()">+Suggest</button>
                               </div>
                           {{/if}}

 

<script>
function myFunction() {
 var x = document.getElementById("suggestbox");
 if (x.style.display === "none") {
   x.style.display = "block";
 } else {
   x.style.display = "none";
 }
}
</script>

 

<div id="suggestbox" class="tab-content hidden">
                       <form action="{{$data.canonical_url}}" method="post" data-form="ajax">
                           <div class="generic-error hidden"></div>
                           <div class="success hidden">{{$lang.videos.video_details_success_message_flag}}</div>
                           <input type="hidden" name="video_id" value="{{$data.video_id}}">
                               <textarea id="flag_message" name="flag_message" rows="3" class="textarea" placeholder="{{$lang.videos.video_details_field_flag_reason_hint}}"></textarea>
                               <input type="submit" class="submit" value="{{$lang.suggest}}">
                       </form>
               </div>

Link to comment
Share on other sites

If no model:

 

{{if count($data.models)>0}}

<div itemprop="name" itemtype="http://schema.org/Person" class="item">

{{$lang.videos.video_details_label_models}}:

{{foreach item="item" from=$data.models}}

<a itemprop="url" {{if $lang.enable_models=='true'}}href="{{$lang.urls.videos_by_model|replace:"%DIR%":$item.dir|replace:"%ID%":$item.model_id}}"{{/if}}>{{$item.title}}</a>

{{/foreach}}

 

{{else}}

<button onclick="myFunction()">+Suggest</button>

</div>

{{/if}}

Link to comment
Share on other sites

If you have problems with some specific code, please create a support ticket.

 

From what we currently see, in your form code you should also add this hidden input, as we stated on the screenshot:

<input type="hidden" name="flag_id" value="flag_suggest_model"/>

 

And of cause you should also create a new flag for video with External ID = flag_suggest_model (in Categorization -> Flags).

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...