Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nothing is appearing for me #649

Open
DylanB85 opened this issue Apr 8, 2018 · 1 comment
Open

Nothing is appearing for me #649

DylanB85 opened this issue Apr 8, 2018 · 1 comment

Comments

@DylanB85
Copy link

DylanB85 commented Apr 8, 2018

Hi guys, nothing is appearing for me once I've finished following the installation guide. I've created both my comment and thread entity classes as far as I can notice.

`<?php

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use FOS\CommentBundle\Entity\Comment as BaseComment;

/**

  • @ORM/Entity

  • @Orm\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
    /
    class Comment extends BaseComment
    {
    /
    *

    • @Orm\Id
    • @Orm\Column(type="integer")
    • @Orm\GeneratedValue(strategy="AUTO")
      */
      protected $id;

    /**

    • @var Thread
    • @Orm\ManyToOne(targetEntity="AppBundle\Entity\Thread")
      */
      protected $thread;
      }`

`<?php
namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use FOS\CommentBundle\Entity\Thread as BaseThread;

/**

  • @Orm\Entity
  • @Orm\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
    /
    class Thread extends BaseThread
    {
    /
    *
    • @var string $id
    • @Orm\Id
    • @Orm\Column(type="string")
      */
      protected $id;
      }`

I've also issued the command in the command line php bin/console doctrine:schema:update --force, but have not noticed any new tabled in my MySQL Workbench.

I've finally laid out my index.html.twig file like this
`{% extends 'base.html.twig' %}

{% block body %}
{% include '@FOSComment/Thread/async.html.twig' with {'id': 'foo'} %}
{% endblock %}

{% block javascripts %}
<script src="http://code.jquery.com/jquery-3.2.1.js"></script>
{% endblock %}
`

And yet, nothing appears at the end. Could someone with more knowledge on this bundle let me know where I potentially went wrong? If you need to see any more code I'd be more than happy to show you.

Also this is how the JavaScript code looks in the page's source code

`
// thread id

  | var fos_comment_thread_id = 'foo';
  | var fos_comment_thread_view = 'tree';
  |  
  | // api base url to use for initial requests
  | var fos_comment_thread_api_base_url = '/api/threads';
  |  
  | // Snippet for asynchronously loading the comments
  | (function() {
  | var fos_comment_script = document.createElement('script');
  | fos_comment_script.async = true;
  | fos_comment_script.src = '/bundles/foscomment/js/comments.js';
  |  
  | (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(fos_comment_script);
  | })();

`

@arandapablodamian
Copy link

Maybe you need to import first the jquery , and after import the template

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants