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

Add a About Page #2

Closed
Industry4 opened this issue May 17, 2023 · 2 comments
Closed

Add a About Page #2

Industry4 opened this issue May 17, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@Industry4
Copy link
Owner

Industry4 commented May 17, 2023

Using the code: var ExecutingAssembly = System.Reflection.Assembly.GetExecutingAssembly();

Display the following attributes of the .dll :

  • Version
  • Title (this will be the Extension)
  • Description
  • Company (this will be Maintainer) and apply a hyperlink
  • Product
  • Copyright
  • Trademark

Using the example code:
string Title = ExecutingAssembly.GetCustomAttribute<AssemblyTitleAttribute>

The C Sharp Razor example (.cshtml) to dynamically write this out would be:
@Raw(Model.Extension.Model.Version)

Navigation Bars
2 Navigation Bars need to be created for the About Page and the File Page. The following shows you how to re-use html using Razor @Include( )

  • Create a .cshtml file in a folder called SharedRazor - Call it something appropriate to the Navigation Bar. Use the Example Template below:
@model MultiPlug.Base.Http.EdgeApp
@functions {
    public string NavLocationIsHome()
    {
        return Model.Context.Paths.Current == Model.Context.Paths.Home ? "active" : string.Empty;
    }

    public string NavLocationIsAbout()
    {
        return Model.Context.Paths.Current == Model.Context.Paths.Home + "about/" ? "active" : string.Empty;
    }
}

<div class="row-fluid">
    <ul class="nav nav-tabs">
        <li class="@NavLocationIsHome()"><a href="@Raw(Model.Context.Paths.Home)">Home</a></li>
        <li class="@NavLocationIsAbout()"><a href="@Raw(Model.Context.Paths.Home)about/">About</a></li>
        }
    </ul>
</div>
  • Add this to the .dll resources, as you did when you created the About.cshtml file.
  • Create a Template ID in Templates.cs, as you did when you created the About.cshtml file.

You can create conditional html areas by using the following example:

@if ( ! string.IsNullOrEmpty(Model.Extension.Model.Guid) )
{
<li class=""><a href="">Lane</a></li>
}
  • Now you can include the Template in the Home.cshtml and About.cshtml pages by using the following example:

@Include("MultiPlug.Ext.FileImporter.WHAT-EVER-YOU-CALLED-THE-TEMPLATE-ID-ABOVE")

  • Now do the same for File.cshtml - You can do the same, or copy the Navigation Bar html directly into File.cshtml without referencing a new shared navigation bar template.
@Industry4 Industry4 added enhancement New feature or request good first issue Good for newcomers labels May 17, 2023
@Industry4 Industry4 added this to the 1.0.2 milestone May 17, 2023
JBJ05 added a commit that referenced this issue May 23, 2023
@JBJ05
Copy link
Collaborator

JBJ05 commented May 23, 2023

About Page

@JBJ05 JBJ05 closed this as completed May 23, 2023
@Industry4
Copy link
Owner Author

User Interface

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Development

No branches or pull requests

2 participants