I am using a package called chatter and managed to include it in my own post. Now I have a table called games, and every time I create a new game, I also add a chatter discussion. That works.
So, on the single game page, I load the details of the game and the chatter discussions as an iframe. Meaning that now I have an HTML inside an HTML. Users are now able to use chatter discussions.
The controller looks pretty much like this:
public function show(Game $game)
{
// We know this is a game
// Get the category first
$category = DB::table('chatter_categories')->whereName('Game')->first();
// Get the discussion
// A discussion has many post(s)
$discussion = DB::table('chatter_discussion')->whereChatterCategoryId($category->id)->first();
//dd($chatter_post);
return view('games.games', ['game' => $game, 'discussion' => $discussion, 'category' => $category]);
}
Now, in my games.blade I have the following:
<article id="discussion">
<iframe id="myiframe" src="/forums/discussion/{{ $category->slug }}/{{ $discussion->slug }}" style="height: 800px; width: 100%;" frameborder="0" />
</article>
Chatter default page comes with a header and looks like in the image below:
If I view a game that I create, I also see the chatter discussions for that games as expected:
Question: How can I remove the header section of the chatter discussion only on the games page?
If I simply target the header id directly
div#chatter_header{
display: none;
}
It will remove the heading, but that will also go away if I visit chatter original front end view.
This is when I thought of checking the current page URL and the styling accordingly, but this does not work.
My route for the games look like this:
Route::resource('games', 'GameController');