Activities of "alper"

I'll try to reproduce it

You can change the logo from BookStoreBrandingProvider.cs or if you don't have this class in your solution, you can add this to your Web project.

In the below code, the logo is being changed by current tenant name. You can inject any service to this class, and apply your own business logic.

 [Dependency(ReplaceServices = true)]
    public class BookStoreBrandingProvider : DefaultBrandingProvider
    {
        //You can inject services here...
        private readonly ICurrentTenant _currentTenant;

        public BookStoreBrandingProvider(ICurrentTenant currentTenant)
        {
            _currentTenant = currentTenant;
        }

        public override string AppName => "Acme - MyBookStore";

        public override string LogoUrl => GetLogoUrl(false);

        public override string LogoReverseUrl => GetLogoUrl(true);

        private string GetLogoUrl(bool isReverse)
        {
            if (_currentTenant.Name == "MyCustomer")
            {
                return isReverse ? "http://mycustomer.com/logo-reverse.png" : "http://mycustomer.com/logo.png";
            }

            if (_currentTenant.Id.HasValue)
            {
                return $"/images/logo/{_currentTenant.Id}";
            }

            return isReverse ? "/images/logo/my-default-logo-reverse.png" : "/images/logo/my-default-logo.png";
        }
    }

To set the position use CSS. Here's how you can do it MVC project

You can add a global.css and make these customizations in there. To add a global style to the standart contributors. Add this code to the ConfigureServices() method in BookStoreWebModule.cs in the web project

  Configure<AbpBundlingOptions>(options =>
            {
                options
                    .StyleBundles
                    .Configure(StandardBundles.Styles.Global, bundle =>
                    {
                        bundle.AddContributors(typeof(GlobalStyleContributor));
                    });
            });
        public class GlobalStyleContributor : BundleContributor
        {
            public override void ConfigureBundle(BundleConfigurationContext context)
            {
                context.Files.Add("/Pages/global.css");
            }
        }

\Pages\global.css

.account-brand .navbar-brand {
    position: fixed !important;
    top: 20px !important;
    left: 100px !important;
}

I'd like to change logo and position

You can simply disable self-registration from the Settings page.

How can I hide register links so that only admin can create user accounts?

There are standard bundles come from the framework itself. These are CSS and JavaScript bundles. You can get list of these files and remove/add. Open BookStoreWebModule.cs In ConfigureServices() method, add the below code

   Configure<AbpBundlingOptions>(options =>
            {
                options
                    .ScriptBundles
                    .Configure(StandardBundles.Scripts.Global, bundle => {
                        bundle.AddContributors(typeof(RemoveJqueryScriptContributor));
                    });
            });

And add this class,

public class RemoveJqueryScriptContributor : BundleContributor
        {
            public override void ConfigureBundle(BundleConfigurationContext context)
            {
                var jquery = context.Files.FirstOrDefault(x => x.EndsWith("jquery.js", StringComparison.InvariantCultureIgnoreCase));
                if (jquery != null)
                {
                    context.Files.Remove(jquery);
                }
            }
        }

This code removes jquery.js from the standard global scripts bundle.

How do I remove the jquery.js from the bundle?

@edirkzwager coud not reproduce your issue.

@edirkzwager I'll try to reproduce it in a scratch 2.7.0 and get back to you.

It can work but you need to create 2 seperate projects one for EF Core SQL provider and one for EF Core Postgresql. out of the box it doesn't support different providers in the same code-base. for your question, can you check the logs, maybe the host is unreacunreachable

Showing 1801 to 1810 of 1957 entries
Made with ❤️ on ABP v9.0.0-preview Updated on September 20, 2024, 08:30